+
+
+
setShowFiles(false)} prefetchFileContent={() => {}} setCurrentPath={path => void selectFile(path)} />
+
+
+ {relativePaths.map(path => )}
+
+
+ {typeof activeSource === 'string'
+ ?
void run()} />
+ : This file is binary.
}
+
+
+
+
+
setCodePanelPercent(50)} onKeyDown={event => { if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') { event.preventDefault(); setCodePanelPercent(value => Math.max(25, Math.min(75, value + (event.key === 'ArrowRight' ? 2 : -2)))) } }} className={`${rightPaneVisible ? 'lg:flex' : 'lg:hidden'} group relative hidden w-2 shrink-0 touch-none cursor-col-resize items-center justify-center bg-background-default hover:bg-blue-500/15 focus-visible:outline-2 focus-visible:outline-blue-500`}>
+
+
+
+
+
+
{}} onForward={() => {}} onNavigate={navigatePreview} onReload={() => navigatePreview(previewUrl)}>
+
+
+
+ {bootOverlayVisible &&
+
+
+
+
+
+
{error ? 'Could not start example' : installProgress === null ? status : `Installing dependencies... ${Math.round(installProgress * 100)}%`}
+
+
+
+
+ {error &&
{error}
}
+
}
+
+ {showOutput && showPreview && setTerminalPanelPercent(42)} onKeyDown={event => { if (event.key === 'ArrowUp' || event.key === 'ArrowDown') { event.preventDefault(); setTerminalPanelPercent(value => Math.max(18, Math.min(70, value + (event.key === 'ArrowUp' ? 2 : -2)))) } }} className="hidden h-1.5 shrink-0 cursor-row-resize touch-none border-y border-border-default bg-background-subtle hover:bg-background-elevated focus-visible:outline-2 focus-visible:outline-blue-500 lg:block" />}
+
+
+
+
+
+
+ {running && {
+ const client = clientRef.current
+ if (!client) throw Error('The example is not running')
+ return client.listTerminalCommands()
+ }} onListDirectory={async path => {
+ const client = clientRef.current
+ if (!client) throw Error('The example is not running')
+ return client.listDirectory(path)
+ }} theme={resolvedTheme} />}
+
+
+
+
+
+
+
+}
diff --git a/docs/deferred-browser-sandbox/src/components/examples/ExampleSDKWorkbench.client.tsx.disabled b/docs/deferred-browser-sandbox/src/components/examples/ExampleSDKWorkbench.client.tsx.disabled
new file mode 100644
index 000000000..112837e4e
--- /dev/null
+++ b/docs/deferred-browser-sandbox/src/components/examples/ExampleSDKWorkbench.client.tsx.disabled
@@ -0,0 +1,430 @@
+import * as React from 'react'
+import { useTheme } from '~/components/ThemeProvider'
+import { Button } from '~/components/ds/ui'
+import {
+ createSDKExampleSession,
+ decodeSDKProjectFiles,
+} from '~/utils/example-sdk.client'
+import type { SDKProjectFiles } from '~/utils/example-sdk.client'
+import type { ExampleDefinition } from '~/utils/example-workspace'
+import type { CheckpointMetadata } from '@tanstack/browser-sandbox-experimental'
+import { CodeMirrorEditor } from './CodeMirrorEditor.client'
+
+type Session = ReturnType
+type Project = {
+ files: SDKProjectFiles
+ sourceHashes: Record
+ identity: ProjectIdentity
+}
+type SerializedProject = Omit & {
+ files: Record
+ binaryFiles?: Record
+}
+type ProjectIdentity = {
+ version: 1
+ sdkManifestSHA256: string
+ projectSHA256: string
+ configSHA256: string
+}
+type SavedWorkspace = {
+ version: 1
+ projectId: string
+ identity: ProjectIdentity
+ checkpoint: CheckpointMetadata
+}
+
+const databaseName = 'tanstack-browser-sandbox'
+const metadataStoreName = 'saved-workspace-metadata'
+
+function openDatabase() {
+ return new Promise((resolve, reject) => {
+ if (!globalThis.indexedDB) {
+ reject(new Error('This browser does not provide IndexedDB.'))
+ return
+ }
+ const request = indexedDB.open(databaseName, 3)
+ request.onupgradeneeded = () => {
+ if (!request.result.objectStoreNames.contains(metadataStoreName)) request.result.createObjectStore(metadataStoreName)
+ }
+ request.onerror = () => reject(request.error ?? new Error('Could not open saved workspaces.'))
+ request.onblocked = () => reject(new Error('Saved workspaces are blocked by another open tab.'))
+ request.onsuccess = () => resolve(request.result)
+ })
+}
+
+async function readSavedWorkspace(projectId: string) {
+ const database = await openDatabase()
+ try {
+ return await new Promise((resolve, reject) => {
+ const transaction = database.transaction(metadataStoreName, 'readonly')
+ const request = transaction.objectStore(metadataStoreName).get(projectId)
+ request.onerror = () => reject(request.error ?? new Error('Could not read saved workspace metadata.'))
+ transaction.onabort = () => reject(transaction.error ?? new Error('Reading saved workspace metadata was aborted.'))
+ transaction.oncomplete = () => resolve(request.result as SavedWorkspace | undefined)
+ })
+ } finally {
+ database.close()
+ }
+}
+
+async function writeSavedWorkspace(value: SavedWorkspace) {
+ const database = await openDatabase()
+ try {
+ await new Promise((resolve, reject) => {
+ const transaction = database.transaction(metadataStoreName, 'readwrite')
+ transaction.objectStore(metadataStoreName).put(value, value.projectId)
+ transaction.onabort = () => reject(transaction.error ?? new Error('Saving the workspace was aborted.'))
+ transaction.onerror = () => reject(transaction.error ?? new Error('Could not save the workspace.'))
+ transaction.oncomplete = () => resolve()
+ })
+ } finally {
+ database.close()
+ }
+}
+
+function sameIdentity(left: ProjectIdentity, right: ProjectIdentity) {
+ return left.version === right.version &&
+ left.sdkManifestSHA256 === right.sdkManifestSHA256 &&
+ left.projectSHA256 === right.projectSHA256 &&
+ left.configSHA256 === right.configSHA256
+}
+
+function declaredCommand(command: string, args: string[]) {
+ const quote = (value: string) => /^[A-Za-z0-9_./:@=-]+$/.test(value)
+ ? value
+ : `'${value.replaceAll("'", "'\\''")}'`
+ return [command, ...args].map(quote).join(' ')
+}
+
+async function sourceHash(source: string) {
+ const bytes = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(source))
+ return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, '0')).join('')
+}
+
+function readProject(value: unknown): Project {
+ if (!value || typeof value !== 'object') throw new Error('Local SDK project is missing.')
+ const project = value as SerializedProject
+ if (!project.files || typeof project.files !== 'object' || Array.isArray(project.files)) {
+ throw new Error('Local SDK project files are missing.')
+ }
+ for (const [path, source] of Object.entries(project.files)) {
+ if (!path.startsWith('/project/') || path.includes('\\') || path.includes('\0') || path.split('/').some((part, index) => index > 0 && (!part || part === '.' || part === '..')) || typeof source !== 'string') {
+ throw new Error('Invalid local SDK project file: ' + path)
+ }
+ }
+ if (project.binaryFiles !== undefined &&
+ (!project.binaryFiles || typeof project.binaryFiles !== 'object' || Array.isArray(project.binaryFiles))) {
+ throw new Error('Local SDK binary project files are invalid.')
+ }
+ for (const [path, source] of Object.entries(project.binaryFiles ?? {})) {
+ if (!path.startsWith('/project/') || path.includes('\\') || path.includes('\0') || path.split('/').some((part, index) => index > 0 && (!part || part === '.' || part === '..')) || typeof source !== 'string') {
+ throw new Error('Invalid local SDK binary project file: ' + path)
+ }
+ }
+ if (!project.sourceHashes || typeof project.sourceHashes !== 'object' || Array.isArray(project.sourceHashes)) {
+ throw new Error('Local SDK source hashes are missing.')
+ }
+ if (!project.identity || project.identity.version !== 1 ||
+ ![project.identity.sdkManifestSHA256, project.identity.projectSHA256, project.identity.configSHA256].every(value => /^[a-f0-9]{64}$/.test(value))) {
+ throw new Error('Local SDK project identity is missing.')
+ }
+ return {
+ files: decodeSDKProjectFiles(project.files, project.binaryFiles),
+ sourceHashes: project.sourceHashes,
+ identity: project.identity,
+ }
+}
+
+export function ExampleSDKWorkbench({ definition }: { definition: ExampleDefinition }) {
+ const { resolvedTheme } = useTheme()
+ const path = definition.initialFile ?? definition.workspace.entry
+ const relativePath = path.replace(/^\//, '')
+ const virtualPath = '/project/' + relativePath
+ const [source, setSource] = React.useState('')
+ const [loaded, setLoaded] = React.useState(false)
+ const [busy, setBusy] = React.useState(false)
+ const [running, setRunning] = React.useState(false)
+ const [canResume, setCanResume] = React.useState(false)
+ const [status, setStatus] = React.useState('Loading local project')
+ const [error, setError] = React.useState('')
+ const [output, setOutput] = React.useState('')
+ const containerRef = React.useRef(null)
+ const filesRef = React.useRef({})
+ const identityRef = React.useRef(null)
+ const savedRef = React.useRef(null)
+ const pendingSaveRef = React.useRef(null)
+ const sessionRef = React.useRef(null)
+ const generationRef = React.useRef(0)
+ const startedRef = React.useRef(false)
+ const writeTimerRef = React.useRef | undefined>(undefined)
+ const writesRef = React.useRef>(Promise.resolve())
+ const cleanupRef = React.useRef>(Promise.resolve())
+ const cleanupFailedRef = React.useRef(false)
+
+ function clearWriteTimer() {
+ if (writeTimerRef.current !== undefined) clearTimeout(writeTimerRef.current)
+ writeTimerRef.current = undefined
+ }
+
+ function releaseSession() {
+ clearWriteTimer()
+ startedRef.current = false
+ const session = sessionRef.current
+ sessionRef.current = null
+ if (session) {
+ cleanupRef.current = cleanupRef.current.then(() => session.dispose())
+ void cleanupRef.current.catch(() => { cleanupFailedRef.current = true })
+ }
+ return cleanupRef.current
+ }
+
+ React.useEffect(() => {
+ const generation = ++generationRef.current
+ const controller = new AbortController()
+ setLoaded(false)
+ setRunning(false)
+ setCanResume(false)
+ setBusy(false)
+ setError('')
+ setOutput('')
+ setStatus('Loading local project')
+ savedRef.current = null
+ pendingSaveRef.current = null
+ void (async () => {
+ await cleanupRef.current
+ const response = await fetch('/__sandbox-local/project.json', { signal: controller.signal, cache: 'no-store' })
+ if (!response.ok) throw new Error('Local SDK project could not be loaded (' + response.status + ').')
+ const project = readProject(await response.json())
+ const visibleSource = definition.workspace.files[path]
+ const localSource = project.files[virtualPath]
+ const expectedHash = project.sourceHashes[relativePath]
+ if (typeof localSource !== 'string' || typeof visibleSource !== 'string' || !/^[a-f0-9]{64}$/.test(expectedHash ?? '')) {
+ throw new Error('The selected example file has no verified local source.')
+ }
+ const [localHash, visibleHash] = await Promise.all([sourceHash(localSource), sourceHash(visibleSource)])
+ if (localHash !== expectedHash || visibleHash !== expectedHash) {
+ throw new Error('The local source differs from this example. Update the local fixture before running it.')
+ }
+ if (generation !== generationRef.current) return
+ filesRef.current = { ...project.files }
+ identityRef.current = project.identity
+ const saved = await readSavedWorkspace(definition.id)
+ if (generation !== generationRef.current) return
+ if (saved) {
+ if (saved.version !== 1 || saved.projectId !== definition.id || !saved.identity ||
+ saved.checkpoint?.formatVersion !== 1 || saved.checkpoint.key !== `tanstack-example:${definition.id}`) {
+ setError('The saved workspace record is invalid. Run a fresh workspace to replace it.')
+ } else if (!sameIdentity(saved.identity, project.identity)) {
+ setError('The saved workspace was created by a different project or SDK build. Run a fresh workspace to replace it.')
+ } else {
+ savedRef.current = saved
+ setCanResume(true)
+ }
+ } else {
+ savedRef.current = null
+ }
+ setSource(localSource)
+ setLoaded(true)
+ setStatus('Ready')
+ })().catch((cause: unknown) => {
+ if (generation !== generationRef.current) return
+ setError(cause instanceof Error ? cause.message : String(cause))
+ setStatus('Unavailable')
+ })
+ return () => {
+ generationRef.current++
+ controller.abort()
+ void releaseSession().catch(() => undefined)
+ }
+ }, [definition, path, relativePath, virtualPath])
+
+ function queueWrite(session: Session, generation: number, value: string) {
+ const write = writesRef.current.then(async () => {
+ if (generation !== generationRef.current || sessionRef.current !== session) return
+ await session.writeFile(virtualPath, value)
+ })
+ writesRef.current = write.catch(() => undefined)
+ void write.catch((cause: unknown) => {
+ if (generation !== generationRef.current) return
+ setError(cause instanceof Error ? cause.message : String(cause))
+ })
+ return write
+ }
+
+ function updateSource(value: string) {
+ setSource(value)
+ filesRef.current[virtualPath] = value
+ clearWriteTimer()
+ const session = sessionRef.current
+ const generation = generationRef.current
+ if (!session || !startedRef.current) return
+ writeTimerRef.current = setTimeout(() => {
+ writeTimerRef.current = undefined
+ void queueWrite(session, generation, value).catch(() => undefined)
+ }, 150)
+ }
+
+ async function run(resume = false) {
+ if (!loaded || busy || sessionRef.current || cleanupFailedRef.current || !containerRef.current) return
+ const saved = resume ? savedRef.current : null
+ if (resume && !saved) return
+ const generation = ++generationRef.current
+ setBusy(true)
+ setError('')
+ setOutput('')
+ setStatus('Starting')
+ try {
+ await cleanupRef.current
+ if (generation !== generationRef.current || !containerRef.current) return
+ const files = { ...filesRef.current }
+ const session = createSDKExampleSession({
+ container: containerRef.current,
+ files,
+ installCommand: declaredCommand(
+ definition.runtime!.install.command,
+ definition.runtime!.install.args,
+ ),
+ startCommand: declaredCommand(
+ definition.runtime!.start.command,
+ definition.runtime!.start.args,
+ ),
+ externalFetchOrigins: ['-start-basic', '-basic-ssr-file-based'].some(suffix => definition.id.endsWith(suffix))
+ ? ['https://jsonplaceholder.typicode.com']
+ : undefined,
+ externalScriptOrigins: definition.id.endsWith('-basic-ssr-file-based')
+ ? ['https://unpkg.com']
+ : undefined,
+ checkpointKey: `tanstack-example:${definition.id}`,
+ resume,
+ onOutput(value) {
+ if (generation === generationRef.current) setOutput((current) => (current + value).slice(-64000))
+ },
+ onStatus(value) {
+ if (generation === generationRef.current) {
+ setStatus(value)
+ if (value === 'Stopped') {
+ setRunning(false)
+ void releaseSession().catch(cause => setError(String(cause)))
+ }
+ }
+ },
+ })
+ sessionRef.current = session
+ await session.start()
+ if (generation !== generationRef.current || sessionRef.current !== session) return
+ if (saved) {
+ const restoredSource = await session.readFile(virtualPath)
+ filesRef.current[virtualPath] = restoredSource
+ setSource(restoredSource)
+ }
+ startedRef.current = true
+ if (!saved && filesRef.current[virtualPath] !== files[virtualPath]) {
+ await queueWrite(session, generation, String(filesRef.current[virtualPath]))
+ }
+ if (generation !== generationRef.current) return
+ setRunning(true)
+ setStatus('Running')
+ } catch (cause) {
+ if (generation !== generationRef.current) return
+ setError(cause instanceof Error ? cause.message : String(cause))
+ setStatus('Stopped')
+ await releaseSession().catch((cleanupError: unknown) => {
+ if (generation === generationRef.current) setError((current) => current + '\nCleanup failed: ' + String(cleanupError))
+ })
+ } finally {
+ if (generation === generationRef.current) setBusy(false)
+ }
+ }
+
+ async function save() {
+ const pending = pendingSaveRef.current
+ if (pending) {
+ setBusy(true)
+ setError('')
+ try {
+ await writeSavedWorkspace(pending)
+ savedRef.current = pending
+ pendingSaveRef.current = null
+ setCanResume(true)
+ setStatus('Saved')
+ } catch (cause) {
+ setError('Workspace captured but could not be stored. Select Save to retry.\n' + String(cause))
+ } finally {
+ setBusy(false)
+ }
+ return
+ }
+ const session = sessionRef.current
+ const identity = identityRef.current
+ if (!session || !identity || busy || !startedRef.current) return
+ const generation = generationRef.current
+ setBusy(true)
+ setError('')
+ setStatus('Saving')
+ try {
+ clearWriteTimer()
+ await queueWrite(session, generation, String(filesRef.current[virtualPath]))
+ await writesRef.current
+ if (generation !== generationRef.current || sessionRef.current !== session) throw new Error('The running workspace changed before it could be saved.')
+ sessionRef.current = null
+ startedRef.current = false
+ setRunning(false)
+ const checkpoint = await session.save()
+ const record: SavedWorkspace = { version: 1, projectId: definition.id, identity, checkpoint }
+ pendingSaveRef.current = record
+ try {
+ await writeSavedWorkspace(record)
+ } catch (cause) {
+ throw new Error('Workspace captured but could not be stored. Select Save to retry.\n' + String(cause))
+ }
+ savedRef.current = record
+ pendingSaveRef.current = null
+ setCanResume(true)
+ setStatus('Saved')
+ } catch (cause) {
+ setError(cause instanceof Error ? cause.message : String(cause))
+ if (!pendingSaveRef.current) setStatus(sessionRef.current ? 'Running' : 'Stopped')
+ } finally {
+ if (generation === generationRef.current) setBusy(false)
+ }
+ }
+
+ async function stop() {
+ const generation = ++generationRef.current
+ setBusy(true)
+ setRunning(false)
+ setStatus('Stopping')
+ try {
+ await releaseSession()
+ if (generation === generationRef.current) setStatus('Stopped')
+ } catch (cause) {
+ if (generation === generationRef.current) setError('Cleanup failed: ' + String(cause))
+ } finally {
+ if (generation === generationRef.current) setBusy(false)
+ }
+ }
+
+ return (
+
+
+ Local SDK, portable dependencies
+ {status}
+
+
+
+
+
+
+
+ {error ? {error}
: null}
+
+
+
{path}
+ {loaded ?
void run()} />
: null}
+
+
+
+ {output ? {output} : null}
+
+ )
+}
diff --git a/docs/deferred-browser-sandbox/src/components/examples/NativeTerminal.client.tsx.disabled b/docs/deferred-browser-sandbox/src/components/examples/NativeTerminal.client.tsx.disabled
new file mode 100644
index 000000000..6b01e0675
--- /dev/null
+++ b/docs/deferred-browser-sandbox/src/components/examples/NativeTerminal.client.tsx.disabled
@@ -0,0 +1,387 @@
+import * as React from 'react'
+import { FitAddon } from '@xterm/addon-fit'
+import { Terminal } from '@xterm/xterm'
+import '@xterm/xterm/css/xterm.css'
+import type { NativeOwnerClient } from '@tanstack/browser-sandbox-experimental'
+import { readTerminalTheme } from './WebContainerTerminal.client'
+
+type CommandResult = Awaited>
+type InputControl = Pick, 'writeInput' | 'endInput' | 'interrupt' | 'resize'>
+type DirectoryEntry = { name: string; type: 'file' | 'directory' | 'symlink' }
+
+function resolveDirectory(cwd: string, token: string) {
+ const parts = (token.startsWith('/') ? token : `${cwd}/${token}`).split('/')
+ const path: string[] = []
+ for (const part of parts) {
+ if (!part || part === '.') continue
+ if (part === '..') path.pop()
+ else path.push(part)
+ }
+ return '/' + path.join('/')
+}
+
+function commonPrefix(values: string[]) {
+ let prefix = values[0] ?? ''
+ for (const value of values.slice(1)) {
+ while (!value.startsWith(prefix)) prefix = prefix.slice(0, -1)
+ }
+ return prefix
+}
+
+function completionToken(line: string, cursor: number) {
+ let start = 0
+ let decoded = ''
+ let quote: "'" | '"' | null = null
+ let escaped = false
+ for (let index = 0; index < cursor; index++) {
+ const character = line[index]
+ if (escaped) { decoded += character; escaped = false; continue }
+ if (character === '\\' && quote !== "'") { escaped = true; continue }
+ if (quote) {
+ if (character === quote) quote = null
+ else decoded += character
+ continue
+ }
+ if (character === "'" || character === '"') { quote = character; continue }
+ if (/\s/.test(character)) { start = index + 1; decoded = ''; continue }
+ decoded += character
+ }
+ const raw = line.slice(start, cursor)
+ const style: "'" | '"' | null = raw.startsWith("'") ? "'" : raw.startsWith('"') ? '"' : null
+ if (escaped || (quote && quote !== style) || (style && !quote)) return null
+ return { start, decoded, style }
+}
+
+function quoteCompletion(value: string, style: "'" | '"' | null) {
+ if (style === "'") return "'" + value.replaceAll("'", "'\\''")
+ if (style === '"') return '"' + value.replace(/[\\"$`]/g, '\\$&')
+ return value.replace(/([^\p{L}\p{N}_./-])/gu, '\\$1')
+}
+
+export function NativeTerminal({
+ active,
+ focusKey,
+ generation,
+ onCommand,
+ onListCommands,
+ onListDirectory,
+ theme,
+}: {
+ active: boolean
+ focusKey: number
+ generation: number
+ onCommand: (line: string, cwd: string, onOutput: (text: string) => void, signal?: AbortSignal, onControl?: (control: InputControl) => void,
+ size?: { columns: number; rows: number }) => Promise
+ onListCommands: () => Promise
+ onListDirectory: (path: string) => Promise
+ theme: 'dark' | 'light'
+}) {
+ const containerRef = React.useRef(null)
+ const terminalRef = React.useRef(null)
+ const activeRef = React.useRef(active)
+ activeRef.current = active
+ const commandRef = React.useRef(onCommand)
+ const listCommandsRef = React.useRef(onListCommands)
+ const listDirectoryRef = React.useRef(onListDirectory)
+ commandRef.current = onCommand
+ listCommandsRef.current = onListCommands
+ listDirectoryRef.current = onListDirectory
+
+ React.useEffect(() => {
+ const container = containerRef.current
+ if (!container) return
+ let dispose: (() => void) | undefined
+ // React may replay this effect before paint. Only open xterm once that replay can be cancelled.
+ const mountFrame = requestAnimationFrame(() => {
+ const terminal = new Terminal({
+ convertEol: true,
+ cursorBlink: true,
+ cursorStyle: 'bar',
+ fontFamily: getComputedStyle(container).fontFamily,
+ fontSize: window.matchMedia('(min-width: 1024px)').matches ? 12 : 13,
+ lineHeight: 1.25,
+ scrollback: 5_000,
+ theme: readTerminalTheme(container),
+ })
+ const fit = new FitAddon()
+ terminal.loadAddon(fit)
+ terminal.open(container)
+ terminalRef.current = terminal
+ if (terminal.textarea) terminal.textarea.ariaLabel = 'Sandbox terminal'
+ if (active) terminal.focus()
+ let cwd = '/project'
+ let input = ''
+ let cursor = 0
+ let historyDraft = ''
+ let busy = false
+ let activeAbort: AbortController | null = null
+ let activeControl: InputControl | null = null
+ let historyIndex = 0
+ const history: string[] = []
+ const pastedLines: string[] = []
+ let pastedTail = ''
+ const pendingKeys: string[] = []
+ let pendingKeyUnits = 0
+ const promptText = () => `${cwd === '/project' ? 'project' : cwd.slice('/project/'.length)} $ `
+ let promptStartLine = 0
+ let redrawPending = false
+ let redrawInFlight = false
+ let redrawDirty = false
+ const redrawWaiters: Array<() => void> = []
+ const prompt = (onReady?: () => void) => terminal.write(promptText(), () => {
+ promptStartLine = terminal.buffer.active.baseY + terminal.buffer.active.cursorY
+ onReady?.()
+ })
+ prompt()
+ const finishRedraw = () => {
+ redrawInFlight = false
+ if (redrawDirty) { redrawDirty = false; redrawInput(); return }
+ for (const resolve of redrawWaiters.splice(0)) resolve()
+ }
+ const redrawInput = () => {
+ if (redrawPending || redrawInFlight) { redrawDirty = true; return }
+ redrawPending = true
+ terminal.write('', () => {
+ redrawPending = false
+ redrawInFlight = true
+ const prefix = promptText()
+ const value = input
+ const nextCursor = cursor
+ const buffer = terminal.buffer.active
+ const currentLine = buffer.baseY + buffer.cursorY
+ const rowsUp = currentLine - promptStartLine
+ if (rowsUp < 0 || rowsUp > buffer.cursorY) {
+ terminal.write(`\r\n${prefix}${value}`, () => {
+ const end = terminal.buffer.active
+ promptStartLine = end.baseY + end.cursorY - Math.floor((prefix.length + value.length - 1) / Math.max(1, terminal.cols))
+ finishRedraw()
+ })
+ return
+ }
+ terminal.write(`${rowsUp ? `\x1b[${rowsUp}A` : ''}\r\x1b[J${prefix}${value}`, () => {
+ if (nextCursor === value.length) { finishRedraw(); return }
+ const end = terminal.buffer.active
+ const columns = Math.max(1, terminal.cols)
+ const targetOffset = prefix.length + nextCursor
+ const targetLine = promptStartLine + Math.floor((Math.max(1, targetOffset) - 1) / columns)
+ const rowsBack = end.baseY + end.cursorY - targetLine
+ const column = (Math.max(1, targetOffset) - 1) % columns
+ terminal.write(`${rowsBack > 0 ? `\x1b[${rowsBack}A` : ''}\r${column ? `\x1b[${column}C` : ''}`, finishRedraw)
+ })
+ })
+ }
+ const flushRedraw = () => !redrawPending && !redrawInFlight && !redrawDirty
+ ? Promise.resolve()
+ : new Promise(resolve => redrawWaiters.push(resolve))
+ const replaceInput = (value: string, nextCursor = value.length) => {
+ input = value
+ cursor = nextCursor
+ redrawInput()
+ }
+ const completePath = async () => {
+ const original = input
+ const originalCursor = cursor
+ const target = completionToken(input, cursor)
+ if (!target) return
+ const { start, decoded: token, style } = target
+ const slash = token.lastIndexOf('/')
+ const directoryPrefix = token.slice(0, slash + 1)
+ const namePrefix = token.slice(slash + 1)
+ let entries: DirectoryEntry[]
+ try {
+ entries = !input.slice(0, start).trim() && !directoryPrefix
+ ? (await listCommandsRef.current()).map(name => ({ name, type: 'file' as const }))
+ : await listDirectoryRef.current(resolveDirectory(cwd, directoryPrefix || '.'))
+ }
+ catch { terminal.write('\x07'); return }
+ if (input !== original || cursor !== originalCursor) return
+ const matches = entries.filter(entry => entry.name.startsWith(namePrefix) && (namePrefix.startsWith('.') || !entry.name.startsWith('.')))
+ if (!matches.length) { terminal.write('\x07'); return }
+ const names = matches.map(entry => entry.name)
+ const completed = matches.length === 1 ? matches[0].name : commonPrefix(names)
+ if (completed.length > namePrefix.length || matches.length === 1) {
+ const directory = matches.length === 1 && matches[0].type === 'directory'
+ const suffix = matches.length === 1 && !directory ? `${style ?? ''} ` : directory ? '/' : ''
+ const replacement = quoteCompletion(directoryPrefix + completed, style) + suffix
+ replaceInput(input.slice(0, start) + replacement + input.slice(cursor), start + replacement.length)
+ }
+ if (matches.length > 1 && completed.length === namePrefix.length) {
+ busy = true
+ await flushRedraw()
+ const shown = matches.slice(0, 60).map(entry => entry.name + (entry.type === 'directory' ? '/' : '')).join(' ')
+ const more = matches.length > 60 ? ` (${matches.length - 60} more)` : ''
+ terminal.write(`\r\n${shown}${more}\r\n`, () => prompt(() => {
+ redrawInput()
+ void flushRedraw().then(resumePrompt)
+ }))
+ }
+ }
+ const drainPastedLines = () => {
+ if (busy) return
+ const line = pastedLines.shift()
+ if (line !== undefined) {
+ replaceInput(line)
+ handleData('\r')
+ } else if (pastedTail) {
+ replaceInput(pastedTail)
+ pastedTail = ''
+ }
+ }
+ const resumePrompt = () => {
+ busy = false
+ drainPastedLines()
+ while (!busy && pendingKeys.length) {
+ const next = pendingKeys.shift()!
+ pendingKeyUnits -= next.length
+ handleData(next)
+ }
+ }
+ function handleData(data: string) {
+ if (!busy && data.length > 1 && /[\r\n]/.test(data)) {
+ const parts = data.replace(/\r\n?/g, '\n').split('\n')
+ const first = input.slice(0, cursor) + parts.shift() + input.slice(cursor)
+ pastedTail = parts.pop() ?? ''
+ pastedLines.push(first, ...parts)
+ drainPastedLines()
+ return
+ }
+ if (busy) {
+ if (data === '\u0003') {
+ if (activeAbort) { terminal.write('^C\r\n'); activeAbort.abort() }
+ } else if (activeControl && !activeAbort?.signal.aborted) {
+ if (data.length > 1 && /[\r\n]/.test(data)) {
+ const parts = data.replace(/\r\n?/g, '\n').split('\n')
+ terminal.write(data.replace(/\r\n?|\n/g, '\r\n'))
+ input += parts.shift() ?? ''
+ for (const part of parts) {
+ activeControl.writeInput(input + '\n')
+ input = part
+ }
+ } else if (data === '\r' || data === '\n') {
+ terminal.write('\r\n')
+ activeControl.writeInput(input + '\n')
+ input = ''
+ } else if (data === '\u0004') {
+ if (input) activeControl.writeInput(input)
+ input = ''
+ activeControl.endInput()
+ } else if (data === '\u007f') {
+ if (input) { input = input.slice(0, -1); terminal.write('\b \b') }
+ } else if (!data.startsWith('\x1b') && !/[\x00-\x08\x0b-\x1f]/.test(data)) {
+ input += data
+ terminal.write(data)
+ }
+ } else if (pendingKeys.length < 128 && pendingKeyUnits + data.length <= 65536) {
+ pendingKeys.push(data)
+ pendingKeyUnits += data.length
+ } else terminal.write('\x07')
+ return
+ }
+ if (data === '\r' || data === '\n') {
+ const line = input
+ busy = true
+ activeAbort = new AbortController()
+ void flushRedraw().then(() => {
+ input = ''
+ cursor = 0
+ terminal.write('\r\n')
+ if (!line.trim()) { activeAbort = null; prompt(resumePrompt); return }
+ history.push(line)
+ historyIndex = history.length
+ historyDraft = ''
+ if (line === 'clear') { terminal.clear(); activeAbort = null; prompt(resumePrompt); return }
+ void commandRef.current(line, cwd, text => terminal.write(text.replaceAll('\n', '\r\n')), activeAbort?.signal,
+ control => { activeControl = control; control.resize(terminal.cols, terminal.rows) },
+ { columns: terminal.cols, rows: terminal.rows }).then(result => {
+ cwd = result.cwd
+ if (result.exitCode && result.exitCode !== 130) terminal.write(`Exited with code ${result.exitCode}\r\n`)
+ }).catch(error => terminal.write(`\x1b[31m${String(error)}\x1b[0m\r\n`))
+ .finally(() => { activeAbort = null; activeControl = null; input = ''; prompt(resumePrompt) })
+ })
+ } else if (data === '\u007f') {
+ if (!cursor) return
+ replaceInput(input.slice(0, cursor - 1) + input.slice(cursor), cursor - 1)
+ } else if (data === '\x1b[D') {
+ if (cursor) replaceInput(input, cursor - 1)
+ } else if (data === '\x1b[C') {
+ if (cursor < input.length) replaceInput(input, cursor + 1)
+ } else if (data === '\x1b[H' || data === '\x1b[1~' || data === '\u0001') {
+ replaceInput(input, 0)
+ } else if (data === '\x1b[F' || data === '\x1b[4~' || data === '\u0005') {
+ replaceInput(input)
+ } else if (data === '\x1b[3~') {
+ if (cursor < input.length) replaceInput(input.slice(0, cursor) + input.slice(cursor + 1), cursor)
+ } else if (data === '\u0015') {
+ replaceInput(input.slice(cursor), 0)
+ } else if (data === '\u000b') {
+ replaceInput(input.slice(0, cursor), cursor)
+ } else if (data === '\u0017' || data === '\x1b\x7f') {
+ let start = cursor
+ while (start > 0 && /\s/.test(input[start - 1])) start--
+ while (start > 0 && !/\s/.test(input[start - 1])) start--
+ if (start < cursor) replaceInput(input.slice(0, start) + input.slice(cursor), start)
+ } else if (data === '\u0003') {
+ busy = true
+ void flushRedraw().then(() => {
+ terminal.write('^C\r\n')
+ input = ''
+ cursor = 0
+ prompt(resumePrompt)
+ })
+ } else if (data === '\x1b[A' || data === '\x1b[B') {
+ if (!history.length) return
+ if (historyIndex === history.length) historyDraft = input
+ historyIndex = Math.max(0, Math.min(history.length,
+ historyIndex + (data === '\x1b[A' ? -1 : 1)))
+ replaceInput(history[historyIndex] ?? historyDraft)
+ } else if (data === '\u000c') {
+ busy = true
+ void flushRedraw().then(() => {
+ terminal.clear()
+ terminal.write('\x1b[2J\x1b[H', () => {
+ promptStartLine = terminal.buffer.active.baseY + terminal.buffer.active.cursorY
+ redrawInput()
+ void flushRedraw().then(resumePrompt)
+ })
+ })
+ } else if (data === '\t') {
+ void completePath()
+ } else if (!data.startsWith('\x1b') && !/[\x00-\x08\x0b-\x1f]/.test(data)) {
+ if (cursor === input.length && !redrawPending && !redrawInFlight) {
+ input += data
+ cursor += data.length
+ terminal.write(data)
+ } else replaceInput(input.slice(0, cursor) + data + input.slice(cursor), cursor + data.length)
+ }
+ }
+ const listener = terminal.onData(handleData)
+ const onPaste = (event: ClipboardEvent) => {
+ const text = event.clipboardData?.getData('text/plain')
+ if (!text) return
+ event.preventDefault()
+ event.stopImmediatePropagation()
+ handleData(text)
+ }
+ terminal.textarea?.addEventListener('paste', onPaste, true)
+ const resizeObserver = new ResizeObserver(() => {
+ if (container.clientWidth && container.clientHeight) { fit.fit(); activeControl?.resize(terminal.cols, terminal.rows) }
+ })
+ resizeObserver.observe(container)
+ if (container.clientWidth && container.clientHeight) fit.fit()
+ if (activeRef.current) terminal.focus()
+ dispose = () => { terminal.textarea?.removeEventListener('paste', onPaste, true); listener.dispose(); resizeObserver.disconnect(); terminal.dispose(); terminalRef.current = null }
+ })
+ return () => { cancelAnimationFrame(mountFrame); dispose?.() }
+ }, [generation])
+
+ React.useEffect(() => {
+ if (active) terminalRef.current?.focus()
+ }, [active, focusKey])
+
+ React.useEffect(() => {
+ if (terminalRef.current && containerRef.current)
+ terminalRef.current.options.theme = readTerminalTheme(containerRef.current)
+ }, [theme])
+
+ return
+}
diff --git a/docs/deferred-browser-sandbox/src/utils/example-sdk.client.ts.disabled b/docs/deferred-browser-sandbox/src/utils/example-sdk.client.ts.disabled
new file mode 100644
index 000000000..4cae51bf9
--- /dev/null
+++ b/docs/deferred-browser-sandbox/src/utils/example-sdk.client.ts.disabled
@@ -0,0 +1,251 @@
+import {
+ WorkerKernel,
+ WorkerHTTP,
+ WorkerWebSocket,
+ URLPreview,
+ assertSDKRuntimeEnvironment,
+ installProjectCommand,
+ spawnProjectCommand,
+} from '@tanstack/browser-sandbox-experimental'
+import type { CheckpointMetadata, SDKRuntimeProfile } from '@tanstack/browser-sandbox-experimental'
+
+export type SDKProjectFiles = Record
+
+export function decodeSDKProjectFiles(
+ files: Record,
+ binaryFiles: Record = {},
+): SDKProjectFiles {
+ const decoded: SDKProjectFiles = { ...files }
+ for (const [path, source] of Object.entries(binaryFiles)) {
+ if (Object.hasOwn(decoded, path)) throw Error(`Duplicate project file: ${path}`)
+ try {
+ const binary = atob(source)
+ const bytes = Uint8Array.from(binary, character => character.charCodeAt(0))
+ let canonical = ''
+ for (const byte of bytes) canonical += String.fromCharCode(byte)
+ if (btoa(canonical) !== source) throw Error('Non-canonical base64')
+ decoded[path] = bytes
+ } catch {
+ throw Error(`Invalid binary project file: ${path}`)
+ }
+ }
+ return decoded
+}
+
+export function createSDKExampleSession(options: {
+ container: HTMLElement
+ files: SDKProjectFiles
+ checkpointKey?: string
+ resume?: boolean
+ installCommand: string
+ startCommand: string
+ externalFetchOrigins?: string[]
+ externalScriptOrigins?: string[]
+ onOutput(text: string): void
+ onStatus(status: string): void
+}) {
+ let kernel: WorkerKernel | undefined
+ let preview: Awaited> | undefined
+ let mounting: ReturnType | undefined
+ let disposed = false
+ let started = false
+ let cancelPort: (() => void) | undefined
+ let child: Awaited> | undefined
+ let drain: Promise | undefined
+ let closing: Promise | undefined
+ const assertActive = () => { if (disposed) throw Error('Session stopped') }
+ function close(saveCheckpoint: boolean) {
+ if (closing) {
+ if (saveCheckpoint) return Promise.reject(Error('Session is already stopping without a checkpoint'))
+ return closing
+ }
+ disposed = true
+ cancelPort?.()
+ preview?.close()
+ closing = (async () => {
+ let checkpoint: CheckpointMetadata | undefined
+ let failure: unknown
+ try {
+ await mounting?.then(mounted => mounted.close(), () => undefined)
+ await child?.dispose()
+ await drain
+ if (saveCheckpoint) {
+ if (!options.checkpointKey) throw Error('A checkpoint key is required')
+ checkpoint = await kernel?.saveCheckpoint(options.checkpointKey)
+ }
+ } catch (error) {
+ failure = error
+ }
+ try {
+ kernel?.close()
+ await kernel?.shutdown
+ } catch (error) {
+ if (!failure) failure = error
+ }
+ options.onStatus('Stopped')
+ if (failure) throw failure
+ return checkpoint
+ })()
+ return closing
+ }
+ return {
+ dispose: () => close(false).then(() => undefined),
+ async readFile(path: string) {
+ assertActive()
+ if (!kernel) throw Error('Start the app before reading files')
+ if (!path.startsWith('/project/') || path.split('/').includes('..')) throw Error('Invalid project path')
+ return kernel.readText(path)
+ },
+ async save() {
+ const checkpoint = await close(true)
+ if (!checkpoint) throw Error('Workspace checkpoint is unavailable')
+ return checkpoint
+ },
+ async writeFile(path: string, source: string) {
+ assertActive()
+ if (!kernel) throw Error('Start the app before applying edits')
+ if (!path.startsWith('/project/') || path.split('/').includes('..')) throw Error('Invalid project path')
+ await kernel.writeText(path, source)
+ },
+ async start() {
+ if (started) throw Error('Session already started')
+ started = true
+ assertActive()
+ try {
+ if (!crossOriginIsolated) throw Error('The local SDK requires cross-origin isolation')
+ const response = await fetch('/__sandbox-local/config.json')
+ if (!response.ok) throw Error('Local SDK host is unavailable')
+ const config = await response.json() as { previewOrigin: string; appPort: number; env: Record; runtimeProfile: SDKRuntimeProfile }
+ if (!Number.isInteger(config.appPort) || config.appPort < 1 || config.appPort > 65535) throw Error('Invalid configured app port')
+ assertSDKRuntimeEnvironment(config.runtimeProfile)
+ assertActive()
+ kernel = new WorkerKernel(options.resume ? {} : options.files, {
+ assetBaseURL: new URL('/__sandbox-local/runtime/', location.href).href,
+ ...config.runtimeProfile.kernelOptions,
+ maxBytes: 256 * 1024 * 1024,
+ timeoutMs: 120000,
+ workspace: { maxBytes: 256 * 1024 * 1024 },
+ workerMaxBytes: 128 * 1024 * 1024,
+ sharedMemoryPerEngine: { maxBytes: 1280 * 1024 * 1024, growthReservation: true },
+ })
+ if (options.resume) {
+ if (!options.checkpointKey) throw Error('A checkpoint key is required')
+ options.onStatus('Restoring workspace')
+ await kernel.restoreCheckpoint(options.checkpointKey)
+ options.onOutput('Restored saved workspace without installing dependencies.\n')
+ } else {
+ options.onStatus('Installing dependencies')
+ const installed = await installProjectCommand(kernel, options.installCommand, {
+ cwd: '/project',
+ ignoreScripts: true,
+ })
+ options.onOutput(`Installed ${installed.installed} packages. Lifecycle scripts are disabled.\n`)
+ }
+ assertActive()
+ options.onStatus('Starting app')
+ let unsubscribe: (() => void) | undefined
+ let timer: ReturnType | undefined
+ let settled = false
+ const port = new Promise((resolve, reject) => {
+ const finish = (error?: Error, value?: number) => {
+ if (settled) return
+ settled = true
+ clearTimeout(timer)
+ unsubscribe?.()
+ if (error) reject(error)
+ else resolve(value!)
+ }
+ cancelPort = () => finish(Error('App startup cancelled'))
+ timer = setTimeout(() => finish(Error('App did not open a port within 120000ms')), 120000)
+ unsubscribe = kernel!.subscribePorts(event => { if (event.type === 'open' && event.port === config.appPort) finish(undefined, event.port) })
+ if (settled) unsubscribe()
+ })
+ void port.catch(() => {})
+ const process = await spawnProjectCommand(kernel, options.startCommand, {
+ cwd: '/project', env: config.env, guestWasm: true, webAPIs: true,
+ writable: true, workspaceFetch: true,
+ externalFetch: options.externalFetchOrigins?.length ? {
+ allowedOrigins: options.externalFetchOrigins,
+ } : undefined,
+ lifetime: 'session', maxBytes: 256 * 1024 * 1024, timeoutMs: 120000,
+ diagnostics: true,
+ })
+ child = process
+ const processResult = process.wait()
+ let readyResolve!: () => void
+ let readyTimer: ReturnType | undefined
+ const ready = new Promise((resolve, reject) => {
+ readyResolve = resolve
+ readyTimer = setTimeout(() => reject(Error('App did not finish startup within 120000ms')), 120000)
+ })
+ drain = (async () => {
+ const decoder = new TextDecoder()
+ let startupOutput = ''
+ for (;;) {
+ const event = await process.next()
+ if (event?.type === 'stdout' || event?.type === 'stderr') {
+ const text = decoder.decode(event.bytes)
+ options.onOutput(text)
+ startupOutput = (startupOutput + text).slice(-64000)
+ if (/https?:\/\/[^\s]+|ready in/i.test(startupOutput)) readyResolve()
+ } else if (event?.type === 'error') throw Error(event.error.message)
+ else if (!event || event.type === 'exit') break
+ }
+ })()
+ void drain.catch(error => { if (!disposed) options.onOutput(String(error) + '\n') })
+ const appPort = await Promise.race([
+ Promise.all([port, ready]).then(([value]) => value),
+ drain.then(async () => {
+ const result = await processResult
+ throw Error(`App exited before becoming ready (status ${result.exitCode})${result.stderr ? `\n${result.stderr}` : ''}`)
+ }),
+ ]).finally(() => clearTimeout(readyTimer))
+ assertActive()
+ const server = new WorkerHTTP(kernel, appPort, { requestTimeoutMs: 120000 })
+ const readinessDeadline = performance.now() + 30000
+ for (;;) {
+ const response = await server.fetch(new Request(`http://localhost:${appPort}/`, {
+ headers: { Accept: 'text/html' },
+ }))
+ if (response.status < 500) {
+ await response.body?.cancel()
+ break
+ }
+ await response.body?.cancel()
+ if (performance.now() >= readinessDeadline) throw Error(`App HTTP readiness failed with status ${response.status}`)
+ await new Promise(resolve => setTimeout(resolve, 250))
+ }
+ mounting = URLPreview.mount(options.container, {
+ origin: config.previewOrigin,
+ requestTimeoutMs: 120000,
+ server,
+ scriptOrigins: options.externalScriptOrigins,
+ connectOrigins: options.externalFetchOrigins,
+ connectWebSocket: (url, protocols) => {
+ const target = new URL(url)
+ const previewOrigin = new URL(config.previewOrigin)
+ const previewAddress = target.host === previewOrigin.host &&
+ target.protocol === (previewOrigin.protocol === 'https:' ? 'wss:' : 'ws:')
+ const guestLoopback = ['localhost', '127.0.0.1', '[::1]'].includes(target.hostname)
+ const port = previewAddress ? appPort : guestLoopback && target.port ? Number(target.port) : appPort
+ if (!Number.isInteger(port) || port < 1 || port > 65535) throw Error('Invalid guest WebSocket port')
+ return WorkerWebSocket.connect(kernel!, port, config.previewOrigin, url, protocols)
+ },
+ })
+ const mounted = await mounting
+ if (disposed) { mounted.close(); throw Error('Session stopped') }
+ preview = mounted
+ options.onStatus('Preview attached')
+ void process.wait().then(async result => {
+ if (disposed) return
+ options.onOutput(`App exited with status ${result.exitCode}\n`)
+ await close(false)
+ }).catch(error => { if (!disposed) options.onOutput(String(error) + '\n') })
+ } catch (error) {
+ options.onOutput('Startup failed: ' + String(error) + '\n')
+ await close(false).catch(cleanupError => options.onOutput('Cleanup failed: ' + String(cleanupError) + '\n'))
+ throw error
+ } finally { cancelPort?.(); cancelPort = undefined }
+ },
+ }
+}
diff --git a/docs/deferred-browser-sandbox/tests/example-sdk-files.test.ts.disabled b/docs/deferred-browser-sandbox/tests/example-sdk-files.test.ts.disabled
new file mode 100644
index 000000000..3581c0d63
--- /dev/null
+++ b/docs/deferred-browser-sandbox/tests/example-sdk-files.test.ts.disabled
@@ -0,0 +1,27 @@
+import assert from 'node:assert/strict'
+import test from 'node:test'
+import { decodeSDKProjectFiles } from '../src/utils/example-sdk.client'
+
+test('decodes SDK binary project files without changing their bytes', () => {
+ const files = decodeSDKProjectFiles(
+ { '/project/src/main.ts': 'export {}' },
+ { '/project/public/favicon.ico': 'AAECA/8=' },
+ )
+
+ assert.equal(files['/project/src/main.ts'], 'export {}')
+ assert.deepEqual(
+ files['/project/public/favicon.ico'],
+ new Uint8Array([0, 1, 2, 3, 255]),
+ )
+})
+
+test('rejects duplicate and malformed SDK binary project files', () => {
+ assert.throws(
+ () => decodeSDKProjectFiles({ '/project/file': '' }, { '/project/file': 'AA==' }),
+ /Duplicate project file/,
+ )
+ assert.throws(
+ () => decodeSDKProjectFiles({}, { '/project/file': 'not base64' }),
+ /Invalid character|Invalid binary project file/,
+ )
+})
diff --git a/docs/deferred-browser-sandbox/tests/local-browser-sandbox.test.ts.disabled b/docs/deferred-browser-sandbox/tests/local-browser-sandbox.test.ts.disabled
new file mode 100644
index 000000000..e80551982
--- /dev/null
+++ b/docs/deferred-browser-sandbox/tests/local-browser-sandbox.test.ts.disabled
@@ -0,0 +1,36 @@
+import assert from 'node:assert/strict'
+import test from 'node:test'
+import {
+ classifyLocalBrowserSandboxFile,
+ shouldExcludeLocalBrowserSandboxPath,
+} from '../scripts/local-browser-sandbox'
+
+test('classifies lossless UTF-8 as text and preserves binary bytes', () => {
+ assert.deepEqual(
+ classifyLocalBrowserSandboxFile(Buffer.from('export const value = "世界"\n')),
+ { type: 'text', value: 'export const value = "世界"\n' },
+ )
+ assert.deepEqual(
+ classifyLocalBrowserSandboxFile(Buffer.from([0, 1, 2, 3, 255])),
+ { type: 'binary', value: 'AAECA/8=' },
+ )
+ assert.deepEqual(
+ classifyLocalBrowserSandboxFile(Buffer.from([0xc3, 0x28])),
+ { type: 'binary', value: 'wyg=' },
+ )
+})
+
+test('matches production example exclusions at every depth', () => {
+ for (const path of [
+ '.nitro',
+ '.nitro/dev/index.mjs',
+ '.tanstack-start/build',
+ '.tanstack-start/build/client.js',
+ 'playwright-report/index.html',
+ 'test-results/result.json',
+ ]) {
+ assert.equal(shouldExcludeLocalBrowserSandboxPath(path), true, path)
+ }
+ assert.equal(shouldExcludeLocalBrowserSandboxPath('src/.nitro-example.ts'), false)
+ assert.equal(shouldExcludeLocalBrowserSandboxPath('src/routes/index.tsx'), false)
+})
diff --git a/docs/tanchat-builder-tool-port.json b/docs/tanchat-builder-tool-port.json
new file mode 100644
index 000000000..79fb858c9
--- /dev/null
+++ b/docs/tanchat-builder-tool-port.json
@@ -0,0 +1,15 @@
+{
+ "source": "src/routes/api/builder/assist.ts",
+ "sourceRevision": "f2f65d1e96ffb9c001af7d050f63f2c562ca4ef5",
+ "sourceSection": "createWorkspaceTools",
+ "destination": "src/utils/builder-workspace-tools.server.ts",
+ "implementationUnchanged": true,
+ "sourceSectionSha256": "3dc0eaa50126d160b8514206e0be9ae5373f22c6fbc7df627b741845c2c3a20a",
+ "remainingIntegration": "Verify live assistant project creation and edits, upgraded runtime execution, OAuth and MCP behavior, then retire the separate Builder assistant loop and deploy the complete consolidation. Native app release and production verification remain pending.",
+ "integrationEvidence": {
+ "projectPanel": "Uses the existing BuilderProjectPage and ExampleWorkbench, live browser preview and retained state verified.",
+ "assistantProjectTools": "Shared project list, inspect, read, create, revision-checked edit, original package inspection/search/read, runtime upgrade, and dependency manifest mutation are registered through existing discovery. Project saves emit a committed event for picker refresh. Focused checks and full application typecheck passed.",
+ "liveAssistant": "Real included Kimi completed a reply and saved-file task. Project creation was interrupted and remains unverified.",
+ "regression": "Current worktree: 2,050 harness tests passed; 507 original site tests passed and two skipped."
+ }
+}
diff --git a/docs/tanchat-client-port.json b/docs/tanchat-client-port.json
new file mode 100644
index 000000000..e17d239ae
--- /dev/null
+++ b/docs/tanchat-client-port.json
@@ -0,0 +1,1784 @@
+[
+ {
+ "source": "src/client/composer-draft-sync.ts",
+ "destination": "src/chat/client/composer-draft-sync.ts",
+ "sourceSha256": "7e51f9b9b8565bf729f932bcb30896ff0c82d69d429e04df2024573db84c9118",
+ "destinationSha256": "7e51f9b9b8565bf729f932bcb30896ff0c82d69d429e04df2024573db84c9118",
+ "unchanged": true
+ },
+ {
+ "source": "src/client/desktop-compatibility.ts",
+ "destination": "src/chat/client/desktop-compatibility.ts",
+ "sourceSha256": "6b1c81b416938722eba907390fda4bb29dafea615349c882c24b5ba6acf4280f",
+ "destinationSha256": "6b1c81b416938722eba907390fda4bb29dafea615349c882c24b5ba6acf4280f",
+ "unchanged": true
+ },
+ {
+ "source": "src/client/desktop-host.ts",
+ "destination": "src/chat/client/desktop-host.ts",
+ "sourceSha256": "ad5522799dc9c9b249bbd8f715371483aa6b53b132e147ad2890ee1f75244aa8",
+ "destinationSha256": "ad5522799dc9c9b249bbd8f715371483aa6b53b132e147ad2890ee1f75244aa8",
+ "unchanged": true
+ },
+ {
+ "source": "src/client/execution-browser-bridge.ts",
+ "destination": "src/chat/client/execution-browser-bridge.ts",
+ "sourceSha256": "ed5b5c4a8ebe352b3dfa6f65ee71ad0b7a4b16c1ab5e293ce64cf6a3b25993cd",
+ "destinationSha256": "ed5b5c4a8ebe352b3dfa6f65ee71ad0b7a4b16c1ab5e293ce64cf6a3b25993cd",
+ "unchanged": true
+ },
+ {
+ "source": "src/client/execution-command-registry.ts",
+ "destination": "src/chat/client/execution-command-registry.ts",
+ "sourceSha256": "eea07e3ef69ddca58a488889db0d4c2393aa0b1f7556013bd6143ee7b1cc3196",
+ "destinationSha256": "eea07e3ef69ddca58a488889db0d4c2393aa0b1f7556013bd6143ee7b1cc3196",
+ "unchanged": true
+ },
+ {
+ "source": "src/client/execution-history.ts",
+ "destination": "src/chat/client/execution-history.ts",
+ "sourceSha256": "364166557525f1fab0e7dedf89889663b87c1e5c86890d76830b4fd0bbe10c98",
+ "destinationSha256": "364166557525f1fab0e7dedf89889663b87c1e5c86890d76830b4fd0bbe10c98",
+ "unchanged": true
+ },
+ {
+ "source": "src/client/execution-http.ts",
+ "destination": "src/chat/client/execution-http.ts",
+ "sourceSha256": "9d1b01c9fe66c796a175e788be5943433a20961b032ca27bab407be762d9ef42",
+ "destinationSha256": "0ca3def9c1711961e311c381069dee3546f9d279bee91bf300068decf9fcbc27",
+ "unchanged": false,
+ "adaptation": "Transport endpoint uses /api/chat, adds immutable workspace query to all original session and snapshot requests."
+ },
+ {
+ "source": "src/client/execution-owner.ts",
+ "destination": "src/chat/client/execution-owner.ts",
+ "sourceSha256": "6ffe90aaf9e5377779a56e3ffda5e50cdcd7037c835f85b401ce2c7b3957cdcb",
+ "destinationSha256": "6ffe90aaf9e5377779a56e3ffda5e50cdcd7037c835f85b401ce2c7b3957cdcb",
+ "unchanged": true
+ },
+ {
+ "source": "src/client/workspace-collections.ts",
+ "destination": "src/chat/client/workspace-collections.ts",
+ "sourceSha256": "efac841db348323b57f400ddd8d5204787cdeff6c6a8e47434748824fed9f441",
+ "destinationSha256": "efac841db348323b57f400ddd8d5204787cdeff6c6a8e47434748824fed9f441",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/AccountTimezone.tsx",
+ "destination": "src/chat/components/AccountTimezone.tsx",
+ "sourceSha256": "1922baee99c936617c98e962a146740a0517826242ccc6f4383bd05571434797",
+ "destinationSha256": "1922baee99c936617c98e962a146740a0517826242ccc6f4383bd05571434797",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/App.tsx",
+ "destination": "src/chat/components/App.tsx",
+ "sourceSha256": "821cd330da55406be2299d27a58e33c0ce5881f350476744a0ab39e5d9b259c5",
+ "destinationSha256": "b28f24a2ae66f0fdee06b158c8d10c68cebb3956717c5ae08c4f9ae51af2c753",
+ "unchanged": false,
+ "adaptation": "Original App with /chat navigation and shared TanStack sign-in/sign-out integration."
+ },
+ {
+ "source": "src/components/AppUpdates.tsx",
+ "destination": "src/chat/components/AppUpdates.tsx",
+ "sourceSha256": "42ae069fb99650b05703dc7f5eb9fe4def309a3cb5968bf99885fb8b1fd9b8af",
+ "destinationSha256": "df461581aa2710e4f4cfc25d469e8b0da705b1a5a7750c5d5b038665cef5f998",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/Appearance.tsx",
+ "destination": "src/chat/components/Appearance.tsx",
+ "sourceSha256": "bb51abe3014917c68db76cffe6b6b257830d4847d647cf66477714ce5cdff5e9",
+ "destinationSha256": "3467800a96ca8da4a12785ac51fa5349d635903abbce8a4424fc7a175e026fdd",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/AppearanceSettings.tsx",
+ "destination": "src/chat/components/AppearanceSettings.tsx",
+ "sourceSha256": "425c1011ce8ce306f79e315de999a0b8723b97455c389caf29b47a22f1343dd6",
+ "destinationSha256": "425c1011ce8ce306f79e315de999a0b8723b97455c389caf29b47a22f1343dd6",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/AuthPopupForm.tsx",
+ "destination": "src/chat/components/AuthPopupForm.tsx",
+ "sourceSha256": "188249eb1c8f04ddaafdfd38641842b1cc67f8672e679dcade5ec9bd6e28b0cb",
+ "destinationSha256": "188249eb1c8f04ddaafdfd38641842b1cc67f8672e679dcade5ec9bd6e28b0cb",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/AvatarEditor.tsx",
+ "destination": "src/chat/components/AvatarEditor.tsx",
+ "sourceSha256": "dfeaca9ef5bd92cf0f446eb451abc0a6a026b73265f3a158a45c0630ed1c9cd3",
+ "destinationSha256": "dfeaca9ef5bd92cf0f446eb451abc0a6a026b73265f3a158a45c0630ed1c9cd3",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/BotAvatar.tsx",
+ "destination": "src/chat/components/BotAvatar.tsx",
+ "sourceSha256": "de7447cb8fe4d8faa730b87dfa2f969d9cbfe0644ec52f1bfd8ae6a1deccdb24",
+ "destinationSha256": "de7447cb8fe4d8faa730b87dfa2f969d9cbfe0644ec52f1bfd8ae6a1deccdb24",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/BotDrag.tsx",
+ "destination": "src/chat/components/BotDrag.tsx",
+ "sourceSha256": "8ecc7d9a8220a837ae8bddf3b6ebb582c887d7a8f576767afb19894e1bfd88df",
+ "destinationSha256": "8ecc7d9a8220a837ae8bddf3b6ebb582c887d7a8f576767afb19894e1bfd88df",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/BotWorkspace.tsx",
+ "destination": "src/chat/components/BotWorkspace.tsx",
+ "sourceSha256": "9815d66e3dffbfca2bc2651056748e54100d142c0d2d8c69d408cdbc0537903d",
+ "destinationSha256": "9815d66e3dffbfca2bc2651056748e54100d142c0d2d8c69d408cdbc0537903d",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/CommandPalette.tsx",
+ "destination": "src/chat/components/CommandPalette.tsx",
+ "sourceSha256": "1a9845c518e8886bc9e495f824ba9cf9095299df1c00f5afdfef57fdf4f31eb1",
+ "destinationSha256": "1a9845c518e8886bc9e495f824ba9cf9095299df1c00f5afdfef57fdf4f31eb1",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ComposerAttachments.tsx",
+ "destination": "src/chat/components/ComposerAttachments.tsx",
+ "sourceSha256": "ee9e79fb79a7d47351869a24188c6d4180f223c1c1b9b30e1546d9a7be901fe4",
+ "destinationSha256": "ee9e79fb79a7d47351869a24188c6d4180f223c1c1b9b30e1546d9a7be901fe4",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ComposerReferences.tsx",
+ "destination": "src/chat/components/ComposerReferences.tsx",
+ "sourceSha256": "36d9cfee9fdcd521bbdaacb8691a52fb7eee65f88863bea48421f5df4c721e86",
+ "destinationSha256": "36d9cfee9fdcd521bbdaacb8691a52fb7eee65f88863bea48421f5df4c721e86",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConnectionSettings.tsx",
+ "destination": "src/chat/components/ConnectionSettings.tsx",
+ "sourceSha256": "4fad561bf6d3b79989ad29bfa7db0a565b4a0a9ed079ef1c251c41b96452ac67",
+ "destinationSha256": "4fad561bf6d3b79989ad29bfa7db0a565b4a0a9ed079ef1c251c41b96452ac67",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ContextIndicator.tsx",
+ "destination": "src/chat/components/ContextIndicator.tsx",
+ "sourceSha256": "fc44b67cd37b3fe68a05439c9b8f97166d87afe259ca036137f0ae016e76b4e9",
+ "destinationSha256": "fc44b67cd37b3fe68a05439c9b8f97166d87afe259ca036137f0ae016e76b4e9",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationActionEvidence.tsx",
+ "destination": "src/chat/components/ConversationActionEvidence.tsx",
+ "sourceSha256": "b16a828e286e479ceb8ce8cf12534698e040cf7712eecea87139b90dd47666cd",
+ "destinationSha256": "b16a828e286e479ceb8ce8cf12534698e040cf7712eecea87139b90dd47666cd",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationDetails.tsx",
+ "destination": "src/chat/components/ConversationDetails.tsx",
+ "sourceSha256": "87524aa30cf6fd4f0e22cbb45ed53527b1c747c6793710fcb19876c1324939b4",
+ "destinationSha256": "87524aa30cf6fd4f0e22cbb45ed53527b1c747c6793710fcb19876c1324939b4",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationDetailsCard.tsx",
+ "destination": "src/chat/components/ConversationDetailsCard.tsx",
+ "sourceSha256": "9901bb519193249289d8c017166bc17ac45aa39fcea785378deb52eee7c3e572",
+ "destinationSha256": "9901bb519193249289d8c017166bc17ac45aa39fcea785378deb52eee7c3e572",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationMinimap.tsx",
+ "destination": "src/chat/components/ConversationMinimap.tsx",
+ "sourceSha256": "1f6d1251b260d972bc377fb8794845f160dc87648feb36b3a5946015af6522a3",
+ "destinationSha256": "1f6d1251b260d972bc377fb8794845f160dc87648feb36b3a5946015af6522a3",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationNavigator.tsx",
+ "destination": "src/chat/components/ConversationNavigator.tsx",
+ "sourceSha256": "8589903228dc30addfd599ee9459ea483f9f35a625ef8adabd53d38be1e3e453",
+ "destinationSha256": "5f874909d178de56402bc5af5a06f991af0380c0a4fa3992513a9dfb45a1c9f0",
+ "unchanged": false,
+ "adaptation": "Workspace URL namespace moved from /w to /chat/w"
+ },
+ {
+ "source": "src/components/ConversationNavigatorScope.tsx",
+ "destination": "src/chat/components/ConversationNavigatorScope.tsx",
+ "sourceSha256": "e23553aac482af6bf1927b0414d4f2c7a672ad36169dcabe152d634088a5e782",
+ "destinationSha256": "e23553aac482af6bf1927b0414d4f2c7a672ad36169dcabe152d634088a5e782",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationOrigin.tsx",
+ "destination": "src/chat/components/ConversationOrigin.tsx",
+ "sourceSha256": "162dae38c7cd06317245a2cc9e08d67a291adbf21ed224741d2b027777ffe781",
+ "destinationSha256": "162dae38c7cd06317245a2cc9e08d67a291adbf21ed224741d2b027777ffe781",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationSession.tsx",
+ "destination": "src/chat/components/ConversationSession.tsx",
+ "sourceSha256": "b16fc1e3828b0b0f1b1c72ba8d749bec62ad2bc0b54aa8fa932048c2dbb35c43",
+ "destinationSha256": "b16fc1e3828b0b0f1b1c72ba8d749bec62ad2bc0b54aa8fa932048c2dbb35c43",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationThreads.tsx",
+ "destination": "src/chat/components/ConversationThreads.tsx",
+ "sourceSha256": "670f332210d1793233dc04384189421f9200e2015fd39d3679097bc1a5984589",
+ "destinationSha256": "670f332210d1793233dc04384189421f9200e2015fd39d3679097bc1a5984589",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationTurn.tsx",
+ "destination": "src/chat/components/ConversationTurn.tsx",
+ "sourceSha256": "b39243f42dfc7b48133c03455e434b8a02a8da5d76be7a473f5a9ce6335a8e76",
+ "destinationSha256": "b39243f42dfc7b48133c03455e434b8a02a8da5d76be7a473f5a9ce6335a8e76",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationView.tsx",
+ "destination": "src/chat/components/ConversationView.tsx",
+ "sourceSha256": "520bde587d6ea88ab891380e284881ce630b270aac7c07263637053eaffe95c7",
+ "destinationSha256": "520bde587d6ea88ab891380e284881ce630b270aac7c07263637053eaffe95c7",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ConversationWorkspace.tsx",
+ "destination": "src/chat/components/ConversationWorkspace.tsx",
+ "sourceSha256": "b3c88d6e72e5f6f3a91e252be4b89947a0639b937d7ff35a99061921f47d53f4",
+ "destinationSha256": "b3c88d6e72e5f6f3a91e252be4b89947a0639b937d7ff35a99061921f47d53f4",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/CopyBotDialog.tsx",
+ "destination": "src/chat/components/CopyBotDialog.tsx",
+ "sourceSha256": "77a3799b8515248bc6f99ef7ee1469619ec442462762d96582af9dc52db32a35",
+ "destinationSha256": "77a3799b8515248bc6f99ef7ee1469619ec442462762d96582af9dc52db32a35",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/CopyButton.tsx",
+ "destination": "src/chat/components/CopyButton.tsx",
+ "sourceSha256": "12bea22c16ca435096a48db6832d879fcf38265a55b38849600fe5883d67e129",
+ "destinationSha256": "12bea22c16ca435096a48db6832d879fcf38265a55b38849600fe5883d67e129",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/DelegatedTaskHistory.tsx",
+ "destination": "src/chat/components/DelegatedTaskHistory.tsx",
+ "sourceSha256": "9c1a1e3df773826c9df09487b1a6f186b3b26035a25bba9367e8134a9d3e86bb",
+ "destinationSha256": "9c1a1e3df773826c9df09487b1a6f186b3b26035a25bba9367e8134a9d3e86bb",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/DelegatedTasks.tsx",
+ "destination": "src/chat/components/DelegatedTasks.tsx",
+ "sourceSha256": "1b9efe6b8ef599f1e3ddf048d5782217c19dca34a28260ef11be7e1d6c299c27",
+ "destinationSha256": "1b9efe6b8ef599f1e3ddf048d5782217c19dca34a28260ef11be7e1d6c299c27",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/DesktopBrowserPanel.tsx",
+ "destination": "src/chat/components/DesktopBrowserPanel.tsx",
+ "sourceSha256": "7d0f7e8e172b70a8e1563b82f8493479e65f8a950c8f1d4ff292b741734e6206",
+ "destinationSha256": "7d0f7e8e172b70a8e1563b82f8493479e65f8a950c8f1d4ff292b741734e6206",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/DesktopUpdateControls.tsx",
+ "destination": "src/chat/components/DesktopUpdateControls.tsx",
+ "sourceSha256": "662c43f00cfb5f4ea18c848f7969f0fcb0f4635f6200018ab563502e2de39cb4",
+ "destinationSha256": "662c43f00cfb5f4ea18c848f7969f0fcb0f4635f6200018ab563502e2de39cb4",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/DeviceSettings.tsx",
+ "destination": "src/chat/components/DeviceSettings.tsx",
+ "sourceSha256": "6b0ccd5a0b3bf6e63995eaef5975cf06f2108bfa40b7df8ec791450ef815ef6b",
+ "destinationSha256": "6b0ccd5a0b3bf6e63995eaef5975cf06f2108bfa40b7df8ec791450ef815ef6b",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/Dialog.tsx",
+ "destination": "src/chat/components/Dialog.tsx",
+ "sourceSha256": "81b12fedb739daefb59a3e84de88a6ffcb3e0e935dd96977fc6f9b506e1ffe8b",
+ "destinationSha256": "81b12fedb739daefb59a3e84de88a6ffcb3e0e935dd96977fc6f9b506e1ffe8b",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/DraftBot.tsx",
+ "destination": "src/chat/components/DraftBot.tsx",
+ "sourceSha256": "359c6afc64833d98ed51a7eef2bd3ebd9bc4218c3380cca2302c591ff37c3945",
+ "destinationSha256": "359c6afc64833d98ed51a7eef2bd3ebd9bc4218c3380cca2302c591ff37c3945",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/DraftSyncNotice.tsx",
+ "destination": "src/chat/components/DraftSyncNotice.tsx",
+ "sourceSha256": "4ba6f6e3c57c6025ad2a3f48995fc25c5bcc8d6f9b7fee83289065064b0d289a",
+ "destinationSha256": "4ba6f6e3c57c6025ad2a3f48995fc25c5bcc8d6f9b7fee83289065064b0d289a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/EarlierMessages.tsx",
+ "destination": "src/chat/components/EarlierMessages.tsx",
+ "sourceSha256": "aca9c44ce6da184936ff433c56b56e566165348965538b23716ba8c7cdfa9099",
+ "destinationSha256": "aca9c44ce6da184936ff433c56b56e566165348965538b23716ba8c7cdfa9099",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ExecutionOwners.tsx",
+ "destination": "src/chat/components/ExecutionOwners.tsx",
+ "sourceSha256": "a7b78f718751066440ab00efad3d4a28c9aac50f4c13803f2ff3c893ad5e5ca2",
+ "destinationSha256": "a7b78f718751066440ab00efad3d4a28c9aac50f4c13803f2ff3c893ad5e5ca2",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ExecutionPreviewViewport.tsx",
+ "destination": "src/chat/components/ExecutionPreviewViewport.tsx",
+ "sourceSha256": "aa71332e3cb172f90e7991f87a0f52eef474c0be2d5e4858b45e1c699af9c3a9",
+ "destinationSha256": "aa71332e3cb172f90e7991f87a0f52eef474c0be2d5e4858b45e1c699af9c3a9",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ExecutionSessionEvidence.tsx",
+ "destination": "src/chat/components/ExecutionSessionEvidence.tsx",
+ "sourceSha256": "431369ebdebbf10c422a190ce713273e7a7a8cf55081e13f6454fab7df4aa651",
+ "destinationSha256": "431369ebdebbf10c422a190ce713273e7a7a8cf55081e13f6454fab7df4aa651",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ExecutionSessionHistory.tsx",
+ "destination": "src/chat/components/ExecutionSessionHistory.tsx",
+ "sourceSha256": "8dd87c1ca6c016915c5a965c476eaefb9e28fdb19921eeead8521973d2fcb7dd",
+ "destinationSha256": "8dd87c1ca6c016915c5a965c476eaefb9e28fdb19921eeead8521973d2fcb7dd",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ExecutionSessionPanel.tsx",
+ "destination": "src/chat/components/ExecutionSessionPanel.tsx",
+ "sourceSha256": "d1708c889bf72c49261245be26af1d6d905b364e6128f1e28c2108bb3778d14d",
+ "destinationSha256": "d1708c889bf72c49261245be26af1d6d905b364e6128f1e28c2108bb3778d14d",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/FavoriteShortcuts.tsx",
+ "destination": "src/chat/components/FavoriteShortcuts.tsx",
+ "sourceSha256": "44b0f1bacce1321f17e92027fdfde92be5b53d66d9c77a4f91b34b3c4bfc917f",
+ "destinationSha256": "44b0f1bacce1321f17e92027fdfde92be5b53d66d9c77a4f91b34b3c4bfc917f",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/HistoricalReceipts.tsx",
+ "destination": "src/chat/components/HistoricalReceipts.tsx",
+ "sourceSha256": "91dbe7ce61cdef87f97bf7714c080f9a5f24f290eb03389915d809f597f6979b",
+ "destinationSha256": "91dbe7ce61cdef87f97bf7714c080f9a5f24f290eb03389915d809f597f6979b",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/HomeAssetDetail.tsx",
+ "destination": "src/chat/components/HomeAssetDetail.tsx",
+ "sourceSha256": "cd2848f113bfd6bd74262ecd3ff3d5ecd349f726d47ec42a4d35f74d63c5301e",
+ "destinationSha256": "cd2848f113bfd6bd74262ecd3ff3d5ecd349f726d47ec42a4d35f74d63c5301e",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/HomeDashboard.tsx",
+ "destination": "src/chat/components/HomeDashboard.tsx",
+ "sourceSha256": "013b415a94edb1119209a621ad29837ae3327adc3a59ba7cf2119425a16e48f9",
+ "destinationSha256": "f1c81c3ea830e243898e76e1cc805c62c813b611fc0597abcf3b5d1c78e819ff",
+ "unchanged": false,
+ "adaptation": "Workspace URL namespace moved to /chat/w, search reads use exact parent workspace route"
+ },
+ {
+ "source": "src/components/IconButton.tsx",
+ "destination": "src/chat/components/IconButton.tsx",
+ "sourceSha256": "5adc2de5c47a5d1a60fd2b1d934949402b761a95150edb1727e60ac8ffc67d38",
+ "destinationSha256": "5adc2de5c47a5d1a60fd2b1d934949402b761a95150edb1727e60ac8ffc67d38",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/InstallApp.tsx",
+ "destination": "src/chat/components/InstallApp.tsx",
+ "sourceSha256": "ad94b1ff964998ea133f2097f1accd24da977724177d6a81bec20dc942237bc6",
+ "destinationSha256": "ad94b1ff964998ea133f2097f1accd24da977724177d6a81bec20dc942237bc6",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodyAccountSettings.tsx",
+ "destination": "src/chat/components/KodyAccountSettings.tsx",
+ "sourceSha256": "e1fa79f190db3a8fbbe92c49d1e25951be7ec5afaf4e5c2d08c99182201e1e8a",
+ "destinationSha256": "e1fa79f190db3a8fbbe92c49d1e25951be7ec5afaf4e5c2d08c99182201e1e8a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodyAddServer.tsx",
+ "destination": "src/chat/components/KodyAddServer.tsx",
+ "sourceSha256": "6c7f11f9d1891efe38152285b43a85092ab345901a33262d8b0e58917d82f4e8",
+ "destinationSha256": "6c7f11f9d1891efe38152285b43a85092ab345901a33262d8b0e58917d82f4e8",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodyCommunity.tsx",
+ "destination": "src/chat/components/KodyCommunity.tsx",
+ "sourceSha256": "affee442a96abe85e696ec0d10fb06284666dab744e92846812cf294864fa764",
+ "destinationSha256": "affee442a96abe85e696ec0d10fb06284666dab744e92846812cf294864fa764",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodyJobControl.tsx",
+ "destination": "src/chat/components/KodyJobControl.tsx",
+ "sourceSha256": "eec83bab56a527ed0171e2c450092d7e023379df7c8c5259c739379236e67e53",
+ "destinationSha256": "eec83bab56a527ed0171e2c450092d7e023379df7c8c5259c739379236e67e53",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodyMail.tsx",
+ "destination": "src/chat/components/KodyMail.tsx",
+ "sourceSha256": "c0e54015b1a1b083f6582e64570b7843385ee8b3156c13dbc0406ca7dc8343f0",
+ "destinationSha256": "c0e54015b1a1b083f6582e64570b7843385ee8b3156c13dbc0406ca7dc8343f0",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodyMemoryCreateReview.tsx",
+ "destination": "src/chat/components/KodyMemoryCreateReview.tsx",
+ "sourceSha256": "ddcac2c092cd8f194f110282d4a8192e48a0936afce180d2d43a055a8c7ec207",
+ "destinationSha256": "ddcac2c092cd8f194f110282d4a8192e48a0936afce180d2d43a055a8c7ec207",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodyMemorySearch.tsx",
+ "destination": "src/chat/components/KodyMemorySearch.tsx",
+ "sourceSha256": "0b49a918f365b5dad3195e580023a99ecc2f09d018dcd9554ce6011d936e1fc7",
+ "destinationSha256": "0b49a918f365b5dad3195e580023a99ecc2f09d018dcd9554ce6011d936e1fc7",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodyResources.tsx",
+ "destination": "src/chat/components/KodyResources.tsx",
+ "sourceSha256": "ce0791a9c0d81ed8115b8b5ce601a263dd456203dee5995c6dc8cdb1823ff736",
+ "destinationSha256": "ab1dd942c071992e770a3e1a4a772f5eb50ba1de31a3e393891b8f5995d2c565",
+ "unchanged": false,
+ "adaptation": "Workspace URL namespace moved from /w to /chat/w"
+ },
+ {
+ "source": "src/components/KodyRunDetails.tsx",
+ "destination": "src/chat/components/KodyRunDetails.tsx",
+ "sourceSha256": "1d3203d103e77c7ac404b0255441872b86328a1408da1864d41e94552ff9ea25",
+ "destinationSha256": "1d3203d103e77c7ac404b0255441872b86328a1408da1864d41e94552ff9ea25",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodyRunHistory.tsx",
+ "destination": "src/chat/components/KodyRunHistory.tsx",
+ "sourceSha256": "52a50522bd193a77a70473adf84ccfff77fc301a9a1f6575c04cddb952a8c4f2",
+ "destinationSha256": "52a50522bd193a77a70473adf84ccfff77fc301a9a1f6575c04cddb952a8c4f2",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodySavedPackages.tsx",
+ "destination": "src/chat/components/KodySavedPackages.tsx",
+ "sourceSha256": "443c4d6c6bfbb2fb503dde284f891f1b01c5ddac21a246e3e7282eedc11ea97b",
+ "destinationSha256": "443c4d6c6bfbb2fb503dde284f891f1b01c5ddac21a246e3e7282eedc11ea97b",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/KodyUsage.tsx",
+ "destination": "src/chat/components/KodyUsage.tsx",
+ "sourceSha256": "7b184aefe8cc593c7d23d10eb7f03df5fe007799e30995e8e47e425c4b179c3a",
+ "destinationSha256": "7b184aefe8cc593c7d23d10eb7f03df5fe007799e30995e8e47e425c4b179c3a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/McpContractInspector.tsx",
+ "destination": "src/chat/components/McpContractInspector.tsx",
+ "sourceSha256": "edfa0a78a0514ebfd44e2f5c8e2b35c2022fe57b421aa1f9806b90cede0c267a",
+ "destinationSha256": "edfa0a78a0514ebfd44e2f5c8e2b35c2022fe57b421aa1f9806b90cede0c267a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/MemoryPanel.tsx",
+ "destination": "src/chat/components/MemoryPanel.tsx",
+ "sourceSha256": "b8ad5429eec8e3afddfeba4cc9ba27d6a779cb5506c2818705c0c20158e156d9",
+ "destinationSha256": "b8ad5429eec8e3afddfeba4cc9ba27d6a779cb5506c2818705c0c20158e156d9",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/MessageAttachments.tsx",
+ "destination": "src/chat/components/MessageAttachments.tsx",
+ "sourceSha256": "7e764630ddbd482a3822a36175e9e8677b8ec0d0a15b12883f32bd7755323e6a",
+ "destinationSha256": "7e764630ddbd482a3822a36175e9e8677b8ec0d0a15b12883f32bd7755323e6a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/MessageMarkdown.tsx",
+ "destination": "src/chat/components/MessageMarkdown.tsx",
+ "sourceSha256": "2907adb5186d54a0e80478d04fe8f5a7838dbe8392177c2d2e100891ba7bba01",
+ "destinationSha256": "2907adb5186d54a0e80478d04fe8f5a7838dbe8392177c2d2e100891ba7bba01",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/MessageReferences.tsx",
+ "destination": "src/chat/components/MessageReferences.tsx",
+ "sourceSha256": "ac3535dd2aa79522c354a448cf3332eb061b29d56b8af3e656548486ff56a34a",
+ "destinationSha256": "ac3535dd2aa79522c354a448cf3332eb061b29d56b8af3e656548486ff56a34a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/MobileRuntime.tsx",
+ "destination": "src/chat/components/MobileRuntime.tsx",
+ "sourceSha256": "952741b36c5a7d69c0b8965faefc446c07ff5c932b9714f045d27908b24e5384",
+ "destinationSha256": "0bea0c0af5fe722d56de3dfe802f7a8bdb4da536c7907752767407da21b0b44d",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/Onboarding.tsx",
+ "destination": "src/chat/components/Onboarding.tsx",
+ "sourceSha256": "d3e3025cc2c2c9fb0157ec4ec61ded28b5061214d2727e413706a67fbc560339",
+ "destinationSha256": "d3e3025cc2c2c9fb0157ec4ec61ded28b5061214d2727e413706a67fbc560339",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/PackageIdentity.tsx",
+ "destination": "src/chat/components/PackageIdentity.tsx",
+ "sourceSha256": "51ec648f0278516043420579e2c13d3c2dfcf3352653c9bfd03136db25c381e4",
+ "destinationSha256": "51ec648f0278516043420579e2c13d3c2dfcf3352653c9bfd03136db25c381e4",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/PendingMessage.tsx",
+ "destination": "src/chat/components/PendingMessage.tsx",
+ "sourceSha256": "5ab820dc2bcd247bbfb41ba95b4f0a8b8605812a2711d297a2aa74e79bb13a76",
+ "destinationSha256": "5ab820dc2bcd247bbfb41ba95b4f0a8b8605812a2711d297a2aa74e79bb13a76",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/PendingTaskCard.tsx",
+ "destination": "src/chat/components/PendingTaskCard.tsx",
+ "sourceSha256": "bed86befaab0d4afee5af6ac39fa739dd6bc3ffc7048ae5129d0f4b07f83c1c4",
+ "destinationSha256": "bed86befaab0d4afee5af6ac39fa739dd6bc3ffc7048ae5129d0f4b07f83c1c4",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/PersonalAssistant.tsx",
+ "destination": "src/chat/components/PersonalAssistant.tsx",
+ "sourceSha256": "cdc17e13fcebcf83a07250021a92bfe3cca176f69372400884f54057981119d2",
+ "destinationSha256": "cdc17e13fcebcf83a07250021a92bfe3cca176f69372400884f54057981119d2",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/PluginSettings.tsx",
+ "destination": "src/chat/components/PluginSettings.tsx",
+ "sourceSha256": "ced4deb7b3c8f0eabe4d9ea624d33732bfe01245f88e4bd03972f49e58518faa",
+ "destinationSha256": "ced4deb7b3c8f0eabe4d9ea624d33732bfe01245f88e4bd03972f49e58518faa",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/PortalContainer.tsx",
+ "destination": "src/chat/components/PortalContainer.tsx",
+ "sourceSha256": "fe2fc58df8a298bb0adc1324457ede9c6595eeb3539643786f956698d668eaa7",
+ "destinationSha256": "fe2fc58df8a298bb0adc1324457ede9c6595eeb3539643786f956698d668eaa7",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/QueuedMessages.tsx",
+ "destination": "src/chat/components/QueuedMessages.tsx",
+ "sourceSha256": "68c9b695abe26ec2f9b743ac94eca2fdeb1ae8e1313aac02e3659f843d995829",
+ "destinationSha256": "68c9b695abe26ec2f9b743ac94eca2fdeb1ae8e1313aac02e3659f843d995829",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ResizableSidebar.tsx",
+ "destination": "src/chat/components/ResizableSidebar.tsx",
+ "sourceSha256": "96c53aa73fd7863e775b485bdf4c3ceb34e21e4e6f07b4ee05c4f12b2365040a",
+ "destinationSha256": "96c53aa73fd7863e775b485bdf4c3ceb34e21e4e6f07b4ee05c4f12b2365040a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ResponsePreferences.tsx",
+ "destination": "src/chat/components/ResponsePreferences.tsx",
+ "sourceSha256": "13d9d7c0ec157852fd5a7290c0101e91bd278bd8de12f0ebc1f95ce2826ea4de",
+ "destinationSha256": "13d9d7c0ec157852fd5a7290c0101e91bd278bd8de12f0ebc1f95ce2826ea4de",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/RetryBranch.tsx",
+ "destination": "src/chat/components/RetryBranch.tsx",
+ "sourceSha256": "6cc8f2d8852970bd176bd1f237889016b51db256a0a040e1489aec6663c842f4",
+ "destinationSha256": "6cc8f2d8852970bd176bd1f237889016b51db256a0a040e1489aec6663c842f4",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/RetryComposer.tsx",
+ "destination": "src/chat/components/RetryComposer.tsx",
+ "sourceSha256": "27285bcf38e4ec35292e21b5c8b4706e7b9b88c31e5d0d56b087625ee1d3d067",
+ "destinationSha256": "27285bcf38e4ec35292e21b5c8b4706e7b9b88c31e5d0d56b087625ee1d3d067",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/RetryDraftRecovery.tsx",
+ "destination": "src/chat/components/RetryDraftRecovery.tsx",
+ "sourceSha256": "909f1739684ea26deadd257efeb5e4c78f371915878adf05b690c202d8e3b9ec",
+ "destinationSha256": "909f1739684ea26deadd257efeb5e4c78f371915878adf05b690c202d8e3b9ec",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/RetryPreparation.tsx",
+ "destination": "src/chat/components/RetryPreparation.tsx",
+ "sourceSha256": "f86d5f545b1b69de744549be740cd05873765c405b0e14da773ef74857469e06",
+ "destinationSha256": "f86d5f545b1b69de744549be740cd05873765c405b0e14da773ef74857469e06",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/RetryReturn.tsx",
+ "destination": "src/chat/components/RetryReturn.tsx",
+ "sourceSha256": "bd928c23e3c3039ddbedc3bc44707439caffd593f13670f993865512b276f0f6",
+ "destinationSha256": "bd928c23e3c3039ddbedc3bc44707439caffd593f13670f993865512b276f0f6",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/RunModelPicker.tsx",
+ "destination": "src/chat/components/RunModelPicker.tsx",
+ "sourceSha256": "712534c0c62a5a01dffa852ea3eeaa001d07915d192c107c201f45ab1a5681dd",
+ "destinationSha256": "712534c0c62a5a01dffa852ea3eeaa001d07915d192c107c201f45ab1a5681dd",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/SavedFileDeliveries.tsx",
+ "destination": "src/chat/components/SavedFileDeliveries.tsx",
+ "sourceSha256": "f3831ca281c2ec66c80dd48d28eab6bbbadc3f78bf3e9fe476a7ce10cddf3e35",
+ "destinationSha256": "f3831ca281c2ec66c80dd48d28eab6bbbadc3f78bf3e9fe476a7ce10cddf3e35",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/SavedFileText.tsx",
+ "destination": "src/chat/components/SavedFileText.tsx",
+ "sourceSha256": "147d0d5af4470b4de043299baff9861c195ca4fee5e59f363be1bc59b95990ce",
+ "destinationSha256": "147d0d5af4470b4de043299baff9861c195ca4fee5e59f363be1bc59b95990ce",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/SavedFiles.tsx",
+ "destination": "src/chat/components/SavedFiles.tsx",
+ "sourceSha256": "1c65e42d1219d53115ee32a8adb0e571f44cffd540c2ab5a8a98526c8c353be9",
+ "destinationSha256": "1c65e42d1219d53115ee32a8adb0e571f44cffd540c2ab5a8a98526c8c353be9",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ScheduleReview.tsx",
+ "destination": "src/chat/components/ScheduleReview.tsx",
+ "sourceSha256": "bfa06a09d85acfa2de8dfb3de2344f29a90584be1688fa916f989cf40495ab8c",
+ "destinationSha256": "bfa06a09d85acfa2de8dfb3de2344f29a90584be1688fa916f989cf40495ab8c",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/Schedules.tsx",
+ "destination": "src/chat/components/Schedules.tsx",
+ "sourceSha256": "ee3e668c42a333c34681cefd77e0bc0e055e6a5d3dfa9450999aff84881e96d2",
+ "destinationSha256": "ee3e668c42a333c34681cefd77e0bc0e055e6a5d3dfa9450999aff84881e96d2",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/SelectField.tsx",
+ "destination": "src/chat/components/SelectField.tsx",
+ "sourceSha256": "d224a21e0f8efc2963371c31ff4a4686b2c9a9bf7d2e641e6063a97c97cca4eb",
+ "destinationSha256": "d224a21e0f8efc2963371c31ff4a4686b2c9a9bf7d2e641e6063a97c97cca4eb",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/SettingsFocusSection.tsx",
+ "destination": "src/chat/components/SettingsFocusSection.tsx",
+ "sourceSha256": "09cf397fa0720705424d6ebd5d2f5f654e1792897c087f8af40ca6e97686e1e5",
+ "destinationSha256": "09cf397fa0720705424d6ebd5d2f5f654e1792897c087f8af40ca6e97686e1e5",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/SketchPad.tsx",
+ "destination": "src/chat/components/SketchPad.tsx",
+ "sourceSha256": "b76385e821f10e766c8e0edc72e174e5cd90a0e794d390da0890ac0f8fa1c52f",
+ "destinationSha256": "b76385e821f10e766c8e0edc72e174e5cd90a0e794d390da0890ac0f8fa1c52f",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/SkillPreview.tsx",
+ "destination": "src/chat/components/SkillPreview.tsx",
+ "sourceSha256": "9379de4d5d0c1286adc226e84caae7d7e03aa148a4d93ef1821eea247a5c9d26",
+ "destinationSha256": "9379de4d5d0c1286adc226e84caae7d7e03aa148a4d93ef1821eea247a5c9d26",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/SkillSettings.tsx",
+ "destination": "src/chat/components/SkillSettings.tsx",
+ "sourceSha256": "12e62129c01836e94613b730337bc382a3e40449fd9be84f86516681a3e00fc5",
+ "destinationSha256": "12e62129c01836e94613b730337bc382a3e40449fd9be84f86516681a3e00fc5",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/TaskSources.tsx",
+ "destination": "src/chat/components/TaskSources.tsx",
+ "sourceSha256": "96c1dea3bd2f6415bc075e4900967ec6da69fc6a07f9252f3925f4e09c6a7609",
+ "destinationSha256": "96c1dea3bd2f6415bc075e4900967ec6da69fc6a07f9252f3925f4e09c6a7609",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/TaskUsageDetails.tsx",
+ "destination": "src/chat/components/TaskUsageDetails.tsx",
+ "sourceSha256": "1bef7f8eebc55fcc8aa3b5926298037fd1c5eaf361a88db1cc8b623920527fa0",
+ "destinationSha256": "1bef7f8eebc55fcc8aa3b5926298037fd1c5eaf361a88db1cc8b623920527fa0",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ThreadLifecycle.tsx",
+ "destination": "src/chat/components/ThreadLifecycle.tsx",
+ "sourceSha256": "0250e77f7d8fd38b8815b09a032bb166c3977f045bd2f02542fd3c5e0157cde3",
+ "destinationSha256": "0250e77f7d8fd38b8815b09a032bb166c3977f045bd2f02542fd3c5e0157cde3",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ThreadTitle.tsx",
+ "destination": "src/chat/components/ThreadTitle.tsx",
+ "sourceSha256": "cfe2ea6cd0ac6184acec6b4f85c22eaa5a957271afbf4550a6b93cb7981b700e",
+ "destinationSha256": "cfe2ea6cd0ac6184acec6b4f85c22eaa5a957271afbf4550a6b93cb7981b700e",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ToolCallDetails.tsx",
+ "destination": "src/chat/components/ToolCallDetails.tsx",
+ "sourceSha256": "c8b10c26046978f4ba3fc8218d19628521461526f8a02046a666cd434d869b19",
+ "destinationSha256": "c8b10c26046978f4ba3fc8218d19628521461526f8a02046a666cd434d869b19",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/UsageDetails.tsx",
+ "destination": "src/chat/components/UsageDetails.tsx",
+ "sourceSha256": "5485f7391eda40712d6adc7bac42c9e35954f56f23503b0fbfc8600e57b32a91",
+ "destinationSha256": "5485f7391eda40712d6adc7bac42c9e35954f56f23503b0fbfc8600e57b32a91",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/VirtualMessages.tsx",
+ "destination": "src/chat/components/VirtualMessages.tsx",
+ "sourceSha256": "7230dfecc7eeb22756d52c5d5fca4326f2c3bba03b1696b6c5276f01c607ed00",
+ "destinationSha256": "7230dfecc7eeb22756d52c5d5fca4326f2c3bba03b1696b6c5276f01c607ed00",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/WorkflowHistory.tsx",
+ "destination": "src/chat/components/WorkflowHistory.tsx",
+ "sourceSha256": "b4c27754099e52197aeefeb42d53d6e3344d693565889d55e845c0285961a0f0",
+ "destinationSha256": "b4c27754099e52197aeefeb42d53d6e3344d693565889d55e845c0285961a0f0",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/WorkflowStart.tsx",
+ "destination": "src/chat/components/WorkflowStart.tsx",
+ "sourceSha256": "8c855859058650ff943561dd0c6a9d8bca2cddeea08ef5ad36a92002840a0197",
+ "destinationSha256": "8c855859058650ff943561dd0c6a9d8bca2cddeea08ef5ad36a92002840a0197",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/WorkspaceApi.tsx",
+ "destination": "src/chat/components/WorkspaceApi.tsx",
+ "sourceSha256": "1b10cb0c19cf31ba60faeac02e50fb1f24c5e489cb7bd219856b0f4f3d2030bd",
+ "destinationSha256": "c7c363e19a196cafbfefbfd168dcbb5a203b78e3d3fd240294d4cb17af9b5f9b",
+ "unchanged": false,
+ "adaptation": "Canonical /api/chat endpoints with workspaceId query scope, same URL construction for fetch and streams"
+ },
+ {
+ "source": "src/components/WorkspaceCommands.tsx",
+ "destination": "src/chat/components/WorkspaceCommands.tsx",
+ "sourceSha256": "0d83daf68c258911d1e02aef11fecd4d15204c3219e95fe7678cb440e11cd9f8",
+ "destinationSha256": "0d83daf68c258911d1e02aef11fecd4d15204c3219e95fe7678cb440e11cd9f8",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/WorkspaceReview.tsx",
+ "destination": "src/chat/components/WorkspaceReview.tsx",
+ "sourceSha256": "dd4ad32cecf20ad63414b18d3f8432b3bb0df80c247de363469e7ddb4ef252d0",
+ "destinationSha256": "dd4ad32cecf20ad63414b18d3f8432b3bb0df80c247de363469e7ddb4ef252d0",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/account-preferences-client.ts",
+ "destination": "src/chat/components/account-preferences-client.ts",
+ "sourceSha256": "d54b4570e78b4ed49554c4010e92011d7b23edafca6fd976a11c404f5488335c",
+ "destinationSha256": "d54b4570e78b4ed49554c4010e92011d7b23edafca6fd976a11c404f5488335c",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/account-timezone.css",
+ "destination": "src/chat/components/account-timezone.css",
+ "sourceSha256": "0dec6b12d777103e691a845eaf461482dd820e17fd6a80843f9d1289973241ff",
+ "destinationSha256": "fef97d168d414fcac00d7e2275ec499b6855c9c9b500a5fb06d54467f2b9c049",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/app-updates.css",
+ "destination": "src/chat/components/app-updates.css",
+ "sourceSha256": "7ddc118dfd48e3a14b2181c0009d5228f17bca7742945775eed9e03d77058aba",
+ "destinationSha256": "e111e77d521a77584a62953d96d03d591684b9eb07ffd7bfa15ede04203cac36",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/appearance-account.ts",
+ "destination": "src/chat/components/appearance-account.ts",
+ "sourceSha256": "bf15e857caab7716244df7d8b72d722b2bc1c75585a104213a789d314b6ea139",
+ "destinationSha256": "bf15e857caab7716244df7d8b72d722b2bc1c75585a104213a789d314b6ea139",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/appearance-settings.css",
+ "destination": "src/chat/components/appearance-settings.css",
+ "sourceSha256": "22663127c6593b08d0dfda6eb35dc83d593dc45a2e3aad321d1973fa58e2b76e",
+ "destinationSha256": "0f1fb01248b0aee65813349f340bee156e1987470e53e9460caef6ac81c119f2",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/assistant-chat.css",
+ "destination": "src/chat/components/assistant-chat.css",
+ "sourceSha256": "38430bf2b77e0d3acc0bda18e84e06ed2eef41041b1faef6167e48d6a7f4afa4",
+ "destinationSha256": "4524581d18006dc9147208e4399b313ab98906fc07b4f35cb1e280098596bff0",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/bootstrap-onboarding.ts",
+ "destination": "src/chat/components/bootstrap-onboarding.ts",
+ "sourceSha256": "d424c5d3c6e7500c04badb10997c5934b9e8026dc1824739b1358883b273a0fb",
+ "destinationSha256": "d424c5d3c6e7500c04badb10997c5934b9e8026dc1824739b1358883b273a0fb",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/bot-sidebar.ts",
+ "destination": "src/chat/components/bot-sidebar.ts",
+ "sourceSha256": "9fe6b00a3b0e157a2181527a1937209913d06ea8c77a0f9468ee82726f72d41f",
+ "destinationSha256": "9fe6b00a3b0e157a2181527a1937209913d06ea8c77a0f9468ee82726f72d41f",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/bot-workspace.css",
+ "destination": "src/chat/components/bot-workspace.css",
+ "sourceSha256": "e565a72efd3c36ffe1a6d9be8229fdcee6db45e5d208a152e1386a4bdafc658b",
+ "destinationSha256": "0ffc12bcfe5ee87bde19f9fbb7b4939e6dda3f324f99b2b940c537c5c3498f09",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/command-palette.css",
+ "destination": "src/chat/components/command-palette.css",
+ "sourceSha256": "256ad08e8013314b2f3bb9a3fa5030420ba4375a34e207f4f7e5e3d2ce2de54c",
+ "destinationSha256": "8d3e96500af7e815b07093909facc09b6fa4c1e153d54381554c222336e0c819",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/composer-attachments.css",
+ "destination": "src/chat/components/composer-attachments.css",
+ "sourceSha256": "81db01b0470d8080653aa01aae6dd131af8867e1244ec252d68dffae009eb3cb",
+ "destinationSha256": "4551eeeb1162c3cccccff3b2c74c8c1b85b6f4f9390c2a3307a98b55d54c6629",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/composer-focus.ts",
+ "destination": "src/chat/components/composer-focus.ts",
+ "sourceSha256": "1655ba4dbcf598ed0a1f159032109720de6c2c5f8a4d2631d2a187271f19c234",
+ "destinationSha256": "1655ba4dbcf598ed0a1f159032109720de6c2c5f8a4d2631d2a187271f19c234",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/connection-errors.ts",
+ "destination": "src/chat/components/connection-errors.ts",
+ "sourceSha256": "8e7790786553ef39836b7e7185aa9ea53ff585567e86bdd050a005d4bb30e929",
+ "destinationSha256": "8e7790786553ef39836b7e7185aa9ea53ff585567e86bdd050a005d4bb30e929",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/connection-settings.css",
+ "destination": "src/chat/components/connection-settings.css",
+ "sourceSha256": "8b646b3ec89efb41119591e6aa6f91f02becc7b797abd79689107ba1d01512d4",
+ "destinationSha256": "5c30f10cf67472b26f6eabcf918ea78f7810e82617464882bf42cbe440b7e2d1",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/context-indicator.css",
+ "destination": "src/chat/components/context-indicator.css",
+ "sourceSha256": "7c26b5d25b12732ec20e4d35c91d70641c34d4a4b1eae1aba98924d24b7e4a00",
+ "destinationSha256": "0fd73cad1d74bdc852a15bbc8086d6dae19a256ec0e3d5cde52b392fa28a11a8",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/context-summary.ts",
+ "destination": "src/chat/components/context-summary.ts",
+ "sourceSha256": "0b7a0b08afa935d5a8651937b169ef666a712e194c3ff66e8b731e372eb7bd94",
+ "destinationSha256": "0b7a0b08afa935d5a8651937b169ef666a712e194c3ff66e8b731e372eb7bd94",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/conversation-card.css",
+ "destination": "src/chat/components/conversation-card.css",
+ "sourceSha256": "15ef97c2b201cb57567e4c7cca966c5a35643afe649e0ea682bcd05c6b7aa82e",
+ "destinationSha256": "415e94dbd88e69fc1f96f897a4a2e32e3e85d5fa891c62faa3f9e1197748a256",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/conversation-details-card.css",
+ "destination": "src/chat/components/conversation-details-card.css",
+ "sourceSha256": "0c0f60d19520960a156936fa0db087f0c03d45a720776b9489a46b1159919247",
+ "destinationSha256": "435e60a441f5e6ec3b3a86605f3eaa7994299bc57e9237aac51e6d37363b58fd",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/conversation-details.css",
+ "destination": "src/chat/components/conversation-details.css",
+ "sourceSha256": "2fcbbce24d3c70eb4d14888803bb90e91fe6eedb9d61fbaec802212a09603529",
+ "destinationSha256": "79eec76989c25e7c42fcf4b9c30c2f26e6957298f274d8f8abcd0eb8771fa974",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/conversation-navigator.css",
+ "destination": "src/chat/components/conversation-navigator.css",
+ "sourceSha256": "78e41e2e264ebdbe1995c510c0481fd26ed60e59a44afba6b731ee760c5cb633",
+ "destinationSha256": "4cb86507210a12964b348e60c919fb0d1a35feab3930c8a3537344cb45a59cc4",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/conversation-origin.css",
+ "destination": "src/chat/components/conversation-origin.css",
+ "sourceSha256": "2b1c7015057e0260476c2dd8a7458e567ccda209550aac9788b1ad3bd21e1dd5",
+ "destinationSha256": "a6b7709b0c5e6e5e0d6098822e309f3a02e84aca7db0f6df8884b21099da4e66",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/conversation-threads.css",
+ "destination": "src/chat/components/conversation-threads.css",
+ "sourceSha256": "7d21d1fc1add337e14a1ab984281b6042f64fc92b294b5db8f0431581ea8a35c",
+ "destinationSha256": "74c24648ab38a6ce0b3cef98ff359610257441536dac45e45a9baa5562f10df6",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/conversation-workspace.css",
+ "destination": "src/chat/components/conversation-workspace.css",
+ "sourceSha256": "f5aa252ca9fce40f544326de9a7b02113a77ec8a5a9509157e5a92da3459beb1",
+ "destinationSha256": "80f3a1325bbf80b8fbf1c34fe37a81395ca88c11e974d59a3782990f14af410e",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/conversationRouteQuery.ts",
+ "destination": "src/chat/components/conversationRouteQuery.ts",
+ "sourceSha256": "8f81dd890a349efb8e9e11e9839d761e8d196e7bf9e19d8c04be34198f5087a4",
+ "destinationSha256": "8f81dd890a349efb8e9e11e9839d761e8d196e7bf9e19d8c04be34198f5087a4",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/copy-bot-dialog.css",
+ "destination": "src/chat/components/copy-bot-dialog.css",
+ "sourceSha256": "ad714867b03c5cffdf973c258cff1f9420c91e08031f9b78016e5793901f9bc1",
+ "destinationSha256": "8ff2b6978aed7ebe39c52d4eb2ba7eaf22173d6a30e853f63ef851c64bd025ff",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/copy-source.ts",
+ "destination": "src/chat/components/copy-source.ts",
+ "sourceSha256": "3da7bba380c679458251c8612c468d4a7e01ec637fb055d9d4af8307a9cabac0",
+ "destinationSha256": "3da7bba380c679458251c8612c468d4a7e01ec637fb055d9d4af8307a9cabac0",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/deferredPanel.tsx",
+ "destination": "src/chat/components/deferredPanel.tsx",
+ "sourceSha256": "65bc8816c8c6b56158e6f4f887c172356ea1bf0f2ebfe76ba33b81b10dbaad9d",
+ "destinationSha256": "65bc8816c8c6b56158e6f4f887c172356ea1bf0f2ebfe76ba33b81b10dbaad9d",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/delegated-tasks.css",
+ "destination": "src/chat/components/delegated-tasks.css",
+ "sourceSha256": "f917bae5efd83249b6ac6365d56902ab11a5f79c94cfbe37c3541cc9a2b33884",
+ "destinationSha256": "326cbe731b905541f0ca1eeaf576d228e814d3c3f3d074a3b0d9130396560a38",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/desktop-browser-panel.css",
+ "destination": "src/chat/components/desktop-browser-panel.css",
+ "sourceSha256": "1a5a16cc1b50f7834b2c263cc90b229556b8dd146643c991966bc3b5e09117cf",
+ "destinationSha256": "ee084ea1feb558487329805eff9980703c7e4fde6f9fb587c7aa1278ecf84c2f",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/draft-bot.css",
+ "destination": "src/chat/components/draft-bot.css",
+ "sourceSha256": "8df56f7c9b84144b64c9494db4b0aa9be2cb2def9d87f9c98da590000f7c8a82",
+ "destinationSha256": "332af09e9fde77041e9ae09949b9248953d9825a5d1a35ad57bbbc4483c84e1a",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/execution-context.ts",
+ "destination": "src/chat/components/execution-context.ts",
+ "sourceSha256": "a9fa93c3d2eb5ba9ce51d6f8e684832e3950eb6982439f3b5026ea5f292018b9",
+ "destinationSha256": "a9fa93c3d2eb5ba9ce51d6f8e684832e3950eb6982439f3b5026ea5f292018b9",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/execution-preview-viewport.css",
+ "destination": "src/chat/components/execution-preview-viewport.css",
+ "sourceSha256": "496bb296428876e109fd971579c021d25b3095186167081d9f9b45770b56b74c",
+ "destinationSha256": "25950e69c1ed780f5e767d59596d0573e44266dd5166ab2a37e5b582a20c9955",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/execution-session-panel.css",
+ "destination": "src/chat/components/execution-session-panel.css",
+ "sourceSha256": "8e26eeaffa34821ba664581461e2334f30ff3c8520b561194bf4449f4fab47fe",
+ "destinationSha256": "2ff46801ad54356ec0e54db2beedd7bdfaabd4bd9949487443613fdb196927f6",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/generated-file-cache.ts",
+ "destination": "src/chat/components/generated-file-cache.ts",
+ "sourceSha256": "95de5647e842feb0090f5f5cccc7e5bba4569dace23ae84fde50f410b7a3faf4",
+ "destinationSha256": "95de5647e842feb0090f5f5cccc7e5bba4569dace23ae84fde50f410b7a3faf4",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/home-dashboard.css",
+ "destination": "src/chat/components/home-dashboard.css",
+ "sourceSha256": "0ae81f0d612c2e01145106e174bc4d6a1c88629c125f4d14c35dd663c6a985fa",
+ "destinationSha256": "3d47aa90749d8290dd1a1211bf26b17899947bd11516095155bbc1edc2f5e23e",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/home-resources.ts",
+ "destination": "src/chat/components/home-resources.ts",
+ "sourceSha256": "1e6eafff8d75e46ffaaf4e4a28c8d28d0f83554df04f5e05c415bfa861e451bf",
+ "destinationSha256": "1e6eafff8d75e46ffaaf4e4a28c8d28d0f83554df04f5e05c415bfa861e451bf",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/icon-button.css",
+ "destination": "src/chat/components/icon-button.css",
+ "sourceSha256": "837d7394a7b8767490b9cbe3d895d494885a7e52b0e02c265bd0e2b2a067a237",
+ "destinationSha256": "160129d2cdbf224475556a77c025bd118a06f5a34743d9dfefaa9ed13896b52c",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/kody-mail.css",
+ "destination": "src/chat/components/kody-mail.css",
+ "sourceSha256": "24830cbf273c56ffa72b055fa1d9c733fa9b40d7b44954a3e3b826af576037e2",
+ "destinationSha256": "9696ae7c8202610212683388e84ae7d8efbad1b094b0efe854cfe05c18b032f8",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/kody-memory-create-review.css",
+ "destination": "src/chat/components/kody-memory-create-review.css",
+ "sourceSha256": "f033805e7e993580689213267df261e10af14164083d2885cd36e641d66dae7e",
+ "destinationSha256": "2caa638c0aed3603518eb76d33b889f462c7f83fd370db2276707e226426bb38",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/marketing-welcome.css",
+ "destination": "src/chat/components/marketing-welcome.css",
+ "sourceSha256": "71214c3ed7bdfd34da7df2cb917a20e8ad3778e0ef53c4c1054388a3978d1e3e",
+ "destinationSha256": "0812362f17588a18ba642fbbb1d9ff503d5aa637fdbb9fecd1941b5e666e91e6",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/memory-command-store.ts",
+ "destination": "src/chat/components/memory-command-store.ts",
+ "sourceSha256": "ad67e3fb864b4c45dd69748c9ded0f9e22ef72e74e00dcc399dbb83f5f5f1231",
+ "destinationSha256": "ad67e3fb864b4c45dd69748c9ded0f9e22ef72e74e00dcc399dbb83f5f5f1231",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/memory.css",
+ "destination": "src/chat/components/memory.css",
+ "sourceSha256": "decf9e38d1b58bd6c7948de252906229c07ba7f707eb2711b8791af3d708bf90",
+ "destinationSha256": "f8cf0452586a47a28d571b2b614761356c77abffc1845b438794f73642cb5294",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/message-focus.ts",
+ "destination": "src/chat/components/message-focus.ts",
+ "sourceSha256": "3af27ab78510b22a32070f0da72f61c04c14bd78b6ae6b8a9d03f8635d5eabf9",
+ "destinationSha256": "3af27ab78510b22a32070f0da72f61c04c14bd78b6ae6b8a9d03f8635d5eabf9",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/message-interactions.css",
+ "destination": "src/chat/components/message-interactions.css",
+ "sourceSha256": "08de98177610581bdd25f01451e3bdcc17e8f86d4c3b51bef6f2b6b8d0ec43a8",
+ "destinationSha256": "17c933b0027aae153bdd573c94deb67a3dcda2f6ee6f102323316e18d92a12ac",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/message-references.css",
+ "destination": "src/chat/components/message-references.css",
+ "sourceSha256": "da2f9b8d35dcad9dff113f67e115334f9c3ac9b4e14ff73e2fd9c7f935a7da1a",
+ "destinationSha256": "d975ed73bc72adce0aea95b22791eefad7de6f45e762af7815e112c9cf93cc6b",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/mobile-back.ts",
+ "destination": "src/chat/components/mobile-back.ts",
+ "sourceSha256": "08fdb2d628cbe1b1fd466491c296d27b75f50d2a3aa5ffc97746e38dfabffa77",
+ "destinationSha256": "08fdb2d628cbe1b1fd466491c296d27b75f50d2a3aa5ffc97746e38dfabffa77",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/mobile-viewport.ts",
+ "destination": "src/chat/components/mobile-viewport.ts",
+ "sourceSha256": "f772dba936832c8c280eeb9c40084d8ee6a7655e47dea530a7e444776d477a64",
+ "destinationSha256": "f772dba936832c8c280eeb9c40084d8ee6a7655e47dea530a7e444776d477a64",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/model-palette.ts",
+ "destination": "src/chat/components/model-palette.ts",
+ "sourceSha256": "90bfdb91d85c6210c4b7c55febde2769e6ece4528a7e35b04802249c34309d99",
+ "destinationSha256": "90bfdb91d85c6210c4b7c55febde2769e6ece4528a7e35b04802249c34309d99",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/onboarding.css",
+ "destination": "src/chat/components/onboarding.css",
+ "sourceSha256": "83e51284ca4f8b858c9e43715e9ba56c2bc12fdeee13f8ee1e470ea3956a3630",
+ "destinationSha256": "59e8ef190e39d4a93e07e8c4b7992280574814e88f57d78a91e84d0849738861",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/package-browser.css",
+ "destination": "src/chat/components/package-browser.css",
+ "sourceSha256": "25c85bdf500e518faa28318ba1e08da3f57ff0e00d75caf4da771d8cc8bc67e8",
+ "destinationSha256": "de7994d6db28e2567d2ecc4664b89eb299df68628b80948e116ea513975e3699",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/palette-context.ts",
+ "destination": "src/chat/components/palette-context.ts",
+ "sourceSha256": "ee439b828b3ef07c82fe8b79ef4abe8e10c3eba2854776197847b82ed7d64504",
+ "destinationSha256": "ee439b828b3ef07c82fe8b79ef4abe8e10c3eba2854776197847b82ed7d64504",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/palette-types.ts",
+ "destination": "src/chat/components/palette-types.ts",
+ "sourceSha256": "05caeee392e573b61714c7cba6d6622cef8f091952041de41d5a7c4d998309e7",
+ "destinationSha256": "05caeee392e573b61714c7cba6d6622cef8f091952041de41d5a7c4d998309e7",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/personal-assistant.css",
+ "destination": "src/chat/components/personal-assistant.css",
+ "sourceSha256": "c6b759db8c39a41730a1cc61543a200c65fd8094c36a8c294f8ebb4cdd6f4c13",
+ "destinationSha256": "daa651301260ad17e5343dabf73e8e3a021f3fb277a4b96d597d9a2ee1e4bf9b",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/plugin-settings.css",
+ "destination": "src/chat/components/plugin-settings.css",
+ "sourceSha256": "1a17fdf4e260044f682ed95ca3db50c2404f2c19264a2c5860300fac02cd84f4",
+ "destinationSha256": "3b08478ba5e0737516d0ba1ce7cf16697a086a86d3082154785eb644771c1c35",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/queued-messages.css",
+ "destination": "src/chat/components/queued-messages.css",
+ "sourceSha256": "3f5fc19b36e0e9ab7325e98ecae68939ed29602ba027e2f610cc0bd8434c0770",
+ "destinationSha256": "1b5bfdc5a9a56af7cc5a5632e8174f392edef5f2867698006b61709b5eca8d35",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/response-preferences.css",
+ "destination": "src/chat/components/response-preferences.css",
+ "sourceSha256": "da4e0f66f1746bfab6d908f346f1f04a514b32285aff45636f025f864f7d3469",
+ "destinationSha256": "a1107a2cc5235151393e3570a038b6354f5fdedeeb1822c17a4eb6655443aea4",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/retry-composer.css",
+ "destination": "src/chat/components/retry-composer.css",
+ "sourceSha256": "8aa4446d645ef5f6b5d75b4eb6af99de44c7cd1c0e21fffeba500403408051c1",
+ "destinationSha256": "17a487bd306a28a592ffc74e75b4bf39f507a3042c2dc270d6cf399f648735c3",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/retry.css",
+ "destination": "src/chat/components/retry.css",
+ "sourceSha256": "8b15008f6caa7bf7da4cc031b8c48563182222a045c8124c0d78bdef16abd391",
+ "destinationSha256": "71ed548c1fca6f217dd637ecd7cda1b804095d9c87a675a1a80710028eba972e",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/run-model-picker.css",
+ "destination": "src/chat/components/run-model-picker.css",
+ "sourceSha256": "07908f13d7a1a3f3b2e69cd717f8e29d92cc952a333fc28a872e462bb7b7b36d",
+ "destinationSha256": "62b831fd5233b6d47413b4c8929054152d39bc9cba906213bba13a743787f1ed",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/saved-file-deliveries.css",
+ "destination": "src/chat/components/saved-file-deliveries.css",
+ "sourceSha256": "9dbf37420371fa1fc482dccae19686492c1c74c4a4980e2346c0cd568944a4ab",
+ "destinationSha256": "2b1f1da170f4f6b965367f3e0a3756f76f4ae8e27480bb08d3f94c751dfb41f4",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/saved-files.css",
+ "destination": "src/chat/components/saved-files.css",
+ "sourceSha256": "485fe00c803e049e6c93a57b5e5b8d5372ab8fbdce4970d28dec042011da324c",
+ "destinationSha256": "487dcf7c8c27a8bcc3d8121b8471616cb2fd4265a45f246fc529f85a0a3bddb2",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/schedule-review.css",
+ "destination": "src/chat/components/schedule-review.css",
+ "sourceSha256": "1954635213e655a44d348d302a4ea83f310403283d0c56c260a1cbea286dcfa6",
+ "destinationSha256": "41a1226677591c39ede79982465ba47d5cc180267e7c21aa789c74b40ea53d3a",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/scheduled-origin.css",
+ "destination": "src/chat/components/scheduled-origin.css",
+ "sourceSha256": "be68b8f08382063a708efcf392a920937e1f56dcdc00efe3b35b11ca527c0dae",
+ "destinationSha256": "e21a32916a2ef61f4daf5a3fc2a5fd363fc9381cade4e1a5ae9607e95f3bc74d",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/schedules.css",
+ "destination": "src/chat/components/schedules.css",
+ "sourceSha256": "1f05cac2b592d12963884a21c461a2e6ca080ed7e9a8498d6f1b52b2504675c3",
+ "destinationSha256": "9139bcf9fd68e38ef690167a1caf8236472c12de9254a2e739d115e1623bf9f5",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/section-display.ts",
+ "destination": "src/chat/components/section-display.ts",
+ "sourceSha256": "f3d4eeebdd5a1c624a1c2bc878e946aa8510993489bb9c550cfd08ebc0babb79",
+ "destinationSha256": "f3d4eeebdd5a1c624a1c2bc878e946aa8510993489bb9c550cfd08ebc0babb79",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/select-field.css",
+ "destination": "src/chat/components/select-field.css",
+ "sourceSha256": "241e3d0df5b605cab0c67f8b124b1e78d810b19ad9e21eb749b3d12f07efe54f",
+ "destinationSha256": "da6b1669e0761af222aba9fa5e1ca3afed178aceaa62a7d035e8d74ea078fb41",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/sidebar-density.ts",
+ "destination": "src/chat/components/sidebar-density.ts",
+ "sourceSha256": "2c39c07beee34178c2d3d0819136236d8f28e9e897952cbdd7cf64a29bdb4e77",
+ "destinationSha256": "2c39c07beee34178c2d3d0819136236d8f28e9e897952cbdd7cf64a29bdb4e77",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/sidebar-text-size.ts",
+ "destination": "src/chat/components/sidebar-text-size.ts",
+ "sourceSha256": "494a9d329aec4ab933ec791cc5a5405773c4d7ae930bf8661ac231df5a1d58e7",
+ "destinationSha256": "494a9d329aec4ab933ec791cc5a5405773c4d7ae930bf8661ac231df5a1d58e7",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/sketch-pad.css",
+ "destination": "src/chat/components/sketch-pad.css",
+ "sourceSha256": "99ae070eeb45c67ea25fb4035e6902306397048379362c93413cc138257ea25e",
+ "destinationSha256": "f7a84ea006a7f8f6e50d872ddb83a11b2b61e698b8f7671cc79edd34709af0ca",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/skills.css",
+ "destination": "src/chat/components/skills.css",
+ "sourceSha256": "b9601fbb4f7b889f251357edd4bae6856c6bb3be8c61fe468b45ef728aac32d6",
+ "destinationSha256": "ee63cd164eaccc7e48d14363ef54ca54448523d87beb3a71f575d5658efd98e3",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/task-usage.css",
+ "destination": "src/chat/components/task-usage.css",
+ "sourceSha256": "22df63f4a8b7f110b0008fbbd0f31a6d5bd55a62adc7689baae0746369ce790e",
+ "destinationSha256": "d9b37bb775ab8ccdc295e59995053182580f6818b30d95eacf034eeb871af81d",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/thread-lifecycle-store.ts",
+ "destination": "src/chat/components/thread-lifecycle-store.ts",
+ "sourceSha256": "ed54881d4950f385d1138f0854ef48de69cde87532bb76d5388d9427f71ca997",
+ "destinationSha256": "ed54881d4950f385d1138f0854ef48de69cde87532bb76d5388d9427f71ca997",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/ActionCard.tsx",
+ "destination": "src/chat/components/ui/ActionCard.tsx",
+ "sourceSha256": "c2c9ae375a51136fbcd0d932d96a770a8c2841aa79dcd489571ab6e8929cabef",
+ "destinationSha256": "c2c9ae375a51136fbcd0d932d96a770a8c2841aa79dcd489571ab6e8929cabef",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/Button.tsx",
+ "destination": "src/chat/components/ui/Button.tsx",
+ "sourceSha256": "7df01ff1bc6b19f6381b91cee39b1a1bd8090346dfc945f6c6cef26c235002b2",
+ "destinationSha256": "7df01ff1bc6b19f6381b91cee39b1a1bd8090346dfc945f6c6cef26c235002b2",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/Checkbox.tsx",
+ "destination": "src/chat/components/ui/Checkbox.tsx",
+ "sourceSha256": "85e34c149ef48de805763b32ebd38cfb573b417062a4abfedf97bc3bbcfce6dc",
+ "destinationSha256": "85e34c149ef48de805763b32ebd38cfb573b417062a4abfedf97bc3bbcfce6dc",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/LoadingState.tsx",
+ "destination": "src/chat/components/ui/LoadingState.tsx",
+ "sourceSha256": "0551c734561fc303915b0a6005e5f9e0524032e3f75963342fd6983814008cee",
+ "destinationSha256": "0551c734561fc303915b0a6005e5f9e0524032e3f75963342fd6983814008cee",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/Modal.tsx",
+ "destination": "src/chat/components/ui/Modal.tsx",
+ "sourceSha256": "ac1692c935422ddfc1dc034d5d4da8da819902558fbb1d7abe1a569adafe1f80",
+ "destinationSha256": "ac1692c935422ddfc1dc034d5d4da8da819902558fbb1d7abe1a569adafe1f80",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/SegmentedControl.tsx",
+ "destination": "src/chat/components/ui/SegmentedControl.tsx",
+ "sourceSha256": "b5686a890680a3f7128fd70720a11173daac98c5f04e9b7581090df8937321a7",
+ "destinationSha256": "b5686a890680a3f7128fd70720a11173daac98c5f04e9b7581090df8937321a7",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/Switch.tsx",
+ "destination": "src/chat/components/ui/Switch.tsx",
+ "sourceSha256": "6617a23df922e97627708713cc15036b7206792c18851f396d189f23dbc38c3a",
+ "destinationSha256": "6617a23df922e97627708713cc15036b7206792c18851f396d189f23dbc38c3a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/TabPanels.tsx",
+ "destination": "src/chat/components/ui/TabPanels.tsx",
+ "sourceSha256": "fa7da6a7ec2c54f533b078b56f00c69e65ce87576bf55d16a7786bc5e0f40481",
+ "destinationSha256": "fa7da6a7ec2c54f533b078b56f00c69e65ce87576bf55d16a7786bc5e0f40481",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/TextInput.tsx",
+ "destination": "src/chat/components/ui/TextInput.tsx",
+ "sourceSha256": "dabfb3e1a5f5a909c0f4c7d1a1dc1325a7596a484f763d0acd72172bf054366b",
+ "destinationSha256": "dabfb3e1a5f5a909c0f4c7d1a1dc1325a7596a484f763d0acd72172bf054366b",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/action-card.css",
+ "destination": "src/chat/components/ui/action-card.css",
+ "sourceSha256": "d15b48e96c0034f20c206ebdd2816166354e4feafff982740b140311291f6833",
+ "destinationSha256": "6c5f867b240a8796ac8f1e868c245d793488202d3798c34e222f15b1310591b6",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/ui/button.css",
+ "destination": "src/chat/components/ui/button.css",
+ "sourceSha256": "79c8b3baa089b75cdd3c0ec842dd77cd1f0d070e1e5df77e5b3f5e54687b53af",
+ "destinationSha256": "155eba450f9cead8458e5035a5623a88cbb2f1bfd310f36a836b08da4d2cea12",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/ui/checkbox.css",
+ "destination": "src/chat/components/ui/checkbox.css",
+ "sourceSha256": "03dce761efe1dd2bf3b177740e67c3b44b1685fd0aece54b734e2a337d5a4973",
+ "destinationSha256": "05d7e0e86c7341db22040f25d0e21dd6aaa32b7a31518d690391b9beb52a1283",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/ui/loading-state.css",
+ "destination": "src/chat/components/ui/loading-state.css",
+ "sourceSha256": "e67319feebc32ecaa45021cff87571fc5e5849e05222188df37d5c5361d1ab41",
+ "destinationSha256": "568ee5f7a19177f5953c2bd86f3ebc3638629bd5a4a1e9d18d80aba5fb842e7e",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/ui/modal.css",
+ "destination": "src/chat/components/ui/modal.css",
+ "sourceSha256": "66d20cb66351e08198fd09db2ce01049d30a568baed8d18d13ef3d62d03cb714",
+ "destinationSha256": "1d99903995d84d97ae5836fa660d99e9d288f781a1ec89d7f0118257721323fe",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/ui/motion.ts",
+ "destination": "src/chat/components/ui/motion.ts",
+ "sourceSha256": "404f0fed9a9f8518362a57f2d24ec8dc46feed8481ba444f69057b1d0d77a4b1",
+ "destinationSha256": "404f0fed9a9f8518362a57f2d24ec8dc46feed8481ba444f69057b1d0d77a4b1",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/ui/segmented-control.css",
+ "destination": "src/chat/components/ui/segmented-control.css",
+ "sourceSha256": "54010923fdfd12237421fc2c834f8ee66dd175b5f24eba973532325ecec83616",
+ "destinationSha256": "409dba8e407f98987c4c7da5b58f07d752ced054fadf3ac6a5cbc004d90ea982",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/ui/switch.css",
+ "destination": "src/chat/components/ui/switch.css",
+ "sourceSha256": "0797de512b9ceeda37a0b100ff3a4db9524d2981cb1a131e4f6d11198524013d",
+ "destinationSha256": "270c16d31341e3ebf5bba4690c4ebdbf41238a63caf39f503589abe013272a12",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/ui/tab-panels.css",
+ "destination": "src/chat/components/ui/tab-panels.css",
+ "sourceSha256": "c10c7e799ce9e2fb1c34d4937fa7e48a33323f90ff56e92ccd9f9961db9950cb",
+ "destinationSha256": "86e32a63686f0e6586f6d7567c44cfc20011a7ad6f8d9590ccaa523285319dab",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/ui/text-input.css",
+ "destination": "src/chat/components/ui/text-input.css",
+ "sourceSha256": "e750ec63b595095eafb8def4815c9b51971c00a1adf57c582cccf8273a4e92cb",
+ "destinationSha256": "3c9b5d3efc0bb0ce7d9aa682d1e40625c574dc8da750033764535ec1dcbe2514",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/useCloudDraft.ts",
+ "destination": "src/chat/components/useCloudDraft.ts",
+ "sourceSha256": "70e5828290b68384207bbc4b38d37464e748eb01d1b0b4e2351129bc756c6e5c",
+ "destinationSha256": "7d3d0895ea37ee34c826a9ce3af3af372031171a777dd9cb5f8984775d5de238",
+ "unchanged": false,
+ "adaptation": "Only the account composer draft URL changes to the TanStack /api/chat namespace. Original synchronization and revision handling retained."
+ },
+ {
+ "source": "src/components/useComposerAttachments.ts",
+ "destination": "src/chat/components/useComposerAttachments.ts",
+ "sourceSha256": "9d5c572598a9883a1eb1ccedd259fa4eaa870299e4742c43e799834385a74873",
+ "destinationSha256": "9d5c572598a9883a1eb1ccedd259fa4eaa870299e4742c43e799834385a74873",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useComposerDraft.ts",
+ "destination": "src/chat/components/useComposerDraft.ts",
+ "sourceSha256": "838344d907347f9e9793a4d1176ee7205e6db8dc3906de72b227a9c409bf3a58",
+ "destinationSha256": "838344d907347f9e9793a4d1176ee7205e6db8dc3906de72b227a9c409bf3a58",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useComposerReferences.ts",
+ "destination": "src/chat/components/useComposerReferences.ts",
+ "sourceSha256": "6dea3470ef81237ca2f0d184f75d4760ec2c3f4d4d1ca124147ffc3225a39908",
+ "destinationSha256": "6dea3470ef81237ca2f0d184f75d4760ec2c3f4d4d1ca124147ffc3225a39908",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useConversationPalette.ts",
+ "destination": "src/chat/components/useConversationPalette.ts",
+ "sourceSha256": "e2e7ed40792976d2ae9c3583d7927be7febc55666020d0185075655ef878407a",
+ "destinationSha256": "e2e7ed40792976d2ae9c3583d7927be7febc55666020d0185075655ef878407a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useConversationRead.ts",
+ "destination": "src/chat/components/useConversationRead.ts",
+ "sourceSha256": "6a471d8aa553eab3b07747639bab1309279730a11125a93ef756c18d3f3d0f23",
+ "destinationSha256": "6a471d8aa553eab3b07747639bab1309279730a11125a93ef756c18d3f3d0f23",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useDebugDetails.ts",
+ "destination": "src/chat/components/useDebugDetails.ts",
+ "sourceSha256": "f30ddbe780d2d8592f662f668dbc42dd8ec03535db556f32f8cb5dacdd8083b1",
+ "destinationSha256": "f30ddbe780d2d8592f662f668dbc42dd8ec03535db556f32f8cb5dacdd8083b1",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useHomeFavorites.ts",
+ "destination": "src/chat/components/useHomeFavorites.ts",
+ "sourceSha256": "029012602596f45a1d44bab32007d6351959bb6f3c446aaf6692a19f8f99c5f4",
+ "destinationSha256": "029012602596f45a1d44bab32007d6351959bb6f3c446aaf6692a19f8f99c5f4",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useLongPress.ts",
+ "destination": "src/chat/components/useLongPress.ts",
+ "sourceSha256": "3a2898d11d8b29f811078b88a805684c24ebe2bc85c9e4e0d9d2ec0ba8556eed",
+ "destinationSha256": "3a2898d11d8b29f811078b88a805684c24ebe2bc85c9e4e0d9d2ec0ba8556eed",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useMobileDrawer.ts",
+ "destination": "src/chat/components/useMobileDrawer.ts",
+ "sourceSha256": "e32a1ceeb5f608aff41c2c58b69542475b4dbbe364d59dd2e3760108de09e681",
+ "destinationSha256": "e32a1ceeb5f608aff41c2c58b69542475b4dbbe364d59dd2e3760108de09e681",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useNavigatorResize.ts",
+ "destination": "src/chat/components/useNavigatorResize.ts",
+ "sourceSha256": "f815e1d8abe154901095170de4877bdcd936a971933c1ebb541451ec4089db61",
+ "destinationSha256": "f815e1d8abe154901095170de4877bdcd936a971933c1ebb541451ec4089db61",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/usePanelMotion.ts",
+ "destination": "src/chat/components/usePanelMotion.ts",
+ "sourceSha256": "3b5846e632996a4bc3504c7fdcba98bba8429ed37892f90b2d6fb9eac843fd7a",
+ "destinationSha256": "3b5846e632996a4bc3504c7fdcba98bba8429ed37892f90b2d6fb9eac843fd7a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/usePendingSend.ts",
+ "destination": "src/chat/components/usePendingSend.ts",
+ "sourceSha256": "cff633e534d0ba870f704d9470b3e665e04d3e17fa336cdf9381ab6b194fb776",
+ "destinationSha256": "cff633e534d0ba870f704d9470b3e665e04d3e17fa336cdf9381ab6b194fb776",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useRetryAttachments.ts",
+ "destination": "src/chat/components/useRetryAttachments.ts",
+ "sourceSha256": "4c5de2e3962cbab6ef5b61673fa21d50a5e60e3ebaa2616028386e2265c39501",
+ "destinationSha256": "4c5de2e3962cbab6ef5b61673fa21d50a5e60e3ebaa2616028386e2265c39501",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useRetryDraft.ts",
+ "destination": "src/chat/components/useRetryDraft.ts",
+ "sourceSha256": "9a11dd7ea66f0b85051975897ae0de7bfc6ac879ee6c3b1ae7f60e2d4a64a8f7",
+ "destinationSha256": "9a11dd7ea66f0b85051975897ae0de7bfc6ac879ee6c3b1ae7f60e2d4a64a8f7",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useRetryPreparation.ts",
+ "destination": "src/chat/components/useRetryPreparation.ts",
+ "sourceSha256": "110ff61c53981e01c25746951208a6c38b3aa1af8a3eb9044dff48356112000a",
+ "destinationSha256": "110ff61c53981e01c25746951208a6c38b3aa1af8a3eb9044dff48356112000a",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useRunModel.ts",
+ "destination": "src/chat/components/useRunModel.ts",
+ "sourceSha256": "52245670ba369fc47cc97d8d4e6b819a8b0d8ea99a9d75a4d6cde2f46047cc4e",
+ "destinationSha256": "52245670ba369fc47cc97d8d4e6b819a8b0d8ea99a9d75a4d6cde2f46047cc4e",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useSavedFiles.ts",
+ "destination": "src/chat/components/useSavedFiles.ts",
+ "sourceSha256": "5ecb575750768fe247db6ba0010668eb663b3600a17f7a69ea0bcfe2bf95c309",
+ "destinationSha256": "5ecb575750768fe247db6ba0010668eb663b3600a17f7a69ea0bcfe2bf95c309",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useUrlMessageFocus.ts",
+ "destination": "src/chat/components/useUrlMessageFocus.ts",
+ "sourceSha256": "7487f1aa8b7789189b96406b854bd6cf71fd185e3f076b002c31abb630a75af8",
+ "destinationSha256": "7487f1aa8b7789189b96406b854bd6cf71fd185e3f076b002c31abb630a75af8",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/useWorkspaceCollections.ts",
+ "destination": "src/chat/components/useWorkspaceCollections.ts",
+ "sourceSha256": "f3c1e6ff541ec9e922908ff0bf6597f9038f8396f804b4dd4d7b4d2b5a713c16",
+ "destinationSha256": "f3c1e6ff541ec9e922908ff0bf6597f9038f8396f804b4dd4d7b4d2b5a713c16",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/workflow-history.css",
+ "destination": "src/chat/components/workflow-history.css",
+ "sourceSha256": "1c6a97b86af41d489eb2ba2f0166cf37f74326d19736a4b311a3605bc01e901f",
+ "destinationSha256": "8590e448e25ab6f43bf13e917fb523451533f7c6b82f44b448cfc9fd66f13d2f",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/components/workflow-start-store.ts",
+ "destination": "src/chat/components/workflow-start-store.ts",
+ "sourceSha256": "d5eb285843848fd7c7943b30e504ef25f933531183a12f2ea08774e4e2a45108",
+ "destinationSha256": "d5eb285843848fd7c7943b30e504ef25f933531183a12f2ea08774e4e2a45108",
+ "unchanged": true
+ },
+ {
+ "source": "src/components/workspace-review.css",
+ "destination": "src/chat/components/workspace-review.css",
+ "sourceSha256": "a459a2902902ea53f91bc95c54bbf4b80be1db80f4a5d066857e00fbbcb4647e",
+ "destinationSha256": "aa587bf8565bc08b23ed97c642580435ab898dbf7786e3b4b520d0728e09c8a7",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/routes/__root.tsx",
+ "destination": "src/chat/components/ChatShell.tsx",
+ "sourceSha256": "e160b2f67091e8c25801e4a18c47381ffff64abce3e6c3efe3eae4e8ddc8d12d",
+ "destinationSha256": "5ced5ebfe479259c0fae032c4903cba9d32fc6896a59ff01f34d4c3c10c9816f",
+ "unchanged": false,
+ "sourceSection": "Tooltip.Provider and ExecutionOwnersProvider composition around route outlet; shared TanStack Query provider reused"
+ },
+ {
+ "source": "src/routes/w.$workspaceId.b.$botId.tsx",
+ "destination": "src/routes/chat.w.$workspaceId.b.$botId.tsx",
+ "sourceSha256": "7a99118d717d6d712065fd03bc9c7f1ab671658a0514636160b138b3a60d1538",
+ "destinationSha256": "2b8eb53d842a0401feeb6d91a9d8391cac9ee655815e52f227fd21ad63a4fc06",
+ "unchanged": false,
+ "sourceSection": "complete original route, prefixed /chat with destination imports"
+ },
+ {
+ "source": "src/routes/w.$workspaceId.home.$homeSection.tsx",
+ "destination": "src/routes/chat.w.$workspaceId.home.$homeSection.tsx",
+ "sourceSha256": "a5bfe5897c33fe41fbe45ce82618c64324f5cb593f9b1b9f59161b62f121326e",
+ "destinationSha256": "56d46c09ad5577cec1635a0544e8db75ed1e4764ed8abe7790fb3fdfbd57f492",
+ "unchanged": false,
+ "sourceSection": "complete original route, prefixed /chat with destination imports"
+ },
+ {
+ "source": "src/routes/w.$workspaceId.tsx",
+ "destination": "src/routes/chat.w.$workspaceId.tsx",
+ "sourceSha256": "bf2641d50b370471213dccbd05a9a368b969656ce5ea3d76eedf65d8d6b5090c",
+ "destinationSha256": "64b3eba1bfcf70328cacfeb7eb034ea06c17bdffd33433f4bb090fd2792a1904",
+ "unchanged": false,
+ "sourceSection": "complete original route, prefixed /chat with destination imports"
+ },
+ {
+ "source": "tests/composer-draft-sync.test.ts",
+ "destination": "harness-tests/core/browser-composer-draft-sync.test.ts",
+ "sourceSha256": "2b65f8d6ed62dcf7646a6c5e49fe74efb7cb265e7fec8588d81a7cfccbd056f6",
+ "destinationSha256": "8dc964308266a8f8b957c37d324f9e13750fcddbcdc02b6465d35588099f27a0",
+ "unchanged": false,
+ "sourceSection": "complete original test file with source imports relocated to src/chat"
+ },
+ {
+ "source": "tests/desktop-compatibility.test.ts",
+ "destination": "harness-tests/core/browser-desktop-compatibility.test.ts",
+ "sourceSha256": "21a8d9662b63dc6b1f13f5f04e807882eefdb97fe026ed0581a9f06712cf799f",
+ "destinationSha256": "92fdd984ac8f452c5df20b5c2ddee9ceddfd3992341ea835254b3871c66060ac",
+ "unchanged": false,
+ "sourceSection": "complete original test file with source imports relocated to src/chat"
+ },
+ {
+ "source": "tests/execution-browser-bridge.test.ts",
+ "destination": "harness-tests/core/browser-execution-browser-bridge.test.ts",
+ "sourceSha256": "f6b284bb1c95cb5311073ff8a9cfe578356d2318d777a4f36e76226094757bd6",
+ "destinationSha256": "7a539e7e5784c976d9b42a98a9276a6ae00aa6dbde1bcf9968383f8ac257cbd4",
+ "unchanged": false,
+ "sourceSection": "complete original test file with source imports relocated to src/chat"
+ },
+ {
+ "source": "tests/execution-command-registry.test.ts",
+ "destination": "harness-tests/core/browser-execution-command-registry.test.ts",
+ "sourceSha256": "41a7326e733a694ea3d41a0c254ac67c7ef20bb54f0e816288a8bd2630336db3",
+ "destinationSha256": "f6162d36c014ab1dd1d2bc0a2969a2504857aee9995204cd97842690c32f781c",
+ "unchanged": false,
+ "sourceSection": "complete original test file with source imports relocated to src/chat"
+ },
+ {
+ "source": "tests/execution-history.test.ts",
+ "destination": "harness-tests/core/browser-execution-history.test.ts",
+ "sourceSha256": "11a8ba51007387e387f20f32c60bf0e15f43d60e62e62ae1ba5ac0b6424e1601",
+ "destinationSha256": "271afce9d36c41d818a97265fad9b3fac07382c1415ff3fe8aeafbeaf3aa571d",
+ "unchanged": false,
+ "sourceSection": "complete original test file with source imports relocated to src/chat"
+ },
+ {
+ "source": "tests/execution-http.test.ts",
+ "destination": "harness-tests/core/browser-execution-http.test.ts",
+ "sourceSha256": "224c12079ea1e533acd6706a266ecebded16d888d168418b6b80ad5ece0ea22d",
+ "destinationSha256": "a8921029eafe3a4d0c1187f6fca12aeaacc2580f8899b6c23d0083bced8604d0",
+ "unchanged": false,
+ "sourceSection": "complete original test file with source imports relocated to src/chat"
+ },
+ {
+ "source": "tests/execution-owner.test.ts",
+ "destination": "harness-tests/core/browser-execution-owner.test.ts",
+ "sourceSha256": "6994517c5e7c74a850ec43bf0f0feeb846f35150d0c2ddfa1f2643996973d657",
+ "destinationSha256": "4f747781c806fa20415f1dffdc6467855b2480b3109adb560bda5831706d6aae",
+ "unchanged": false,
+ "sourceSection": "complete original test file with source imports relocated to src/chat"
+ },
+ {
+ "source": "tests/workspace-collections.test.ts",
+ "destination": "harness-tests/core/browser-workspace-collections.test.ts",
+ "sourceSha256": "adfc778f1c27dc0171679dda5279d273fc0018560358dcbe14298bde3777c7bb",
+ "destinationSha256": "98107ed0db12cd1779cf8c710375d3f4c847c49e4e023e6891c214a2f45f030a",
+ "unchanged": false,
+ "sourceSection": "complete original test file with source imports relocated to src/chat"
+ },
+ {
+ "source": "src/motion.css",
+ "destination": "src/chat/styles.css",
+ "sourceSha256": "9b7c75273931e81a6ca9551ef6412f7ea8e4abe476eba6ecb2748f16f5193c5a",
+ "destinationSha256": "f7905c4990e90f4420286883a993241952a29b9642366c3182e4714be9bffa98",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/mobile.css",
+ "destination": "src/chat/styles.css",
+ "sourceSha256": "62b7194389f293ebd2384899f600e1b497ebe4f822287827d3a5d610e8d7e24a",
+ "destinationSha256": "f7905c4990e90f4420286883a993241952a29b9642366c3182e4714be9bffa98",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ },
+ {
+ "source": "src/styles.css",
+ "destination": "src/chat/styles.css",
+ "sourceSha256": "43ef29e383fa3e3f33b95bb889b302e745e13d6a6bf189aa4dfcfbbd49fe519d",
+ "destinationSha256": "f7905c4990e90f4420286883a993241952a29b9642366c3182e4714be9bffa98",
+ "unchanged": false,
+ "adaptation": "Original stylesheet rules inside native CSS scope for documents containing .tanchat-shell, retaining body portal support."
+ }
+]
diff --git a/docs/tanchat-consolidation.md b/docs/tanchat-consolidation.md
new file mode 100644
index 000000000..a6eb46aa9
--- /dev/null
+++ b/docs/tanchat-consolidation.md
@@ -0,0 +1,1386 @@
+# TanStack consolidation
+
+September 30, 2026. Status: source audit and implementation plan, not a completed port.
+
+## Required outcome
+
+TanChat lives at `tanstack.com/chat`. `chat.tanstack.com` redirects there. The native application is called TanStack and can contain more than chat. The current TanStack builder assistant is replaced by this harness. Kody remains an optional recommended integration. TanStack owns identity, authorization, infrastructure, and the release process. No old Gum account or conversation data needs to migrate. Start fresh without deleting the old deployment until the replacement is verified.
+
+The complete harness is in scope: conversations and threads, context inheritance, forks, drafts, queues, cancellation, approvals, tool discovery, MCP authorization, Kody synchronization, model providers and gateways, Jev routing, skills, memory, saved files, workflows, schedules, usage, workspace organization, sharing policies, connected devices, native desktop capabilities, offline behavior, and the existing tests. Inventory each capability before claiming parity. Experimental capabilities stay marked as experimental.
+
+## Source evidence
+
+The actual destination checkout is `/Users/tannerlinsley/GitHub/tanstack.com`, not `~/GitHub/tanstack`. It has unrelated active browser-sandbox changes. Preserve those changes and coordinate with the owning sibling before editing shared files.
+
+- `src/auth/auth.server.ts` validates signed session cookies against the user and session version, then loads effective capabilities. Reuse this service, not a second cookie or email-based identity merge.
+- `src/auth/context.server.ts`, `src/utils/auth.server.ts`, and `src/utils/auth.server-helpers.ts` expose the existing authentication integration.
+- `src/db/client.ts` uses request-scoped Postgres through Drizzle. `src/db/schema.ts` already contains users, sessions, OAuth accounts, builder messages, runs, and project events. The source harness uses D1 SQL and per-conversation Durable Object SQLite. These are different persistence contracts, not interchangeable bindings.
+- `src/server.ts` already establishes database and host runtime contexts, observability, and scheduled work. Extend those entry points rather than replacing them with Gum's server entry.
+- `wrangler.jsonc` targets TanStack account `8da95258a9c70b54c3e2b374a0079106` and includes three R2 bindings. The source harness targets personal account `144575f7380700ae3ca2076ac0168566` and requires D1, Workers AI, R2, Workflows, and three Durable Object classes.
+- `src/components/ds/ui`, `src/components/Tooltip.tsx`, and `src/components/markdown` are existing UI reuse candidates. Audit behavior and accessibility before substituting them for harness primitives. Do not retain two competing implementations of the same behavior without a concrete reason.
+- `src/routes/builder.tsx` is more than an assistant. It supports shared examples and a charts builder. `src/routes/builder_.*`, `src/routes/api/builder/*`, and `src/utils/builder-project-*` also support project snapshots, sharing, sync, and quarantine. Replacing the harness must not silently break examples or documentation embeds.
+- The source has 184 server files and 220 component files at audit time. Bulk copying them does not establish integration or completeness.
+
+## Architecture
+
+Use the TanStack site router, auth, user IDs, account controls, database context, observability, and deployment pipeline. Mount the chat feature under `/chat`, with its own layout and lazy loading so marketing and docs do not download the harness.
+
+Keep durable conversation execution and stream objects as Cloudflare Durable Objects in the TanStack account. They own execution serialization, resumable streams, cancellation, and local transcript storage. Put durable account-level chat metadata, membership, provider credentials, integration configuration, and discoverability into TanStack's Postgres/Drizzle schema. Avoid a duplicate users table or a parallel account backend. Use R2 for chat files and large results. Provision fresh resources in the TanStack account. Shared auth does not imply that every conversation request must run inside the marketing page render.
+
+Workers AI and AI Gateway belong to the TanStack account after cutover. Keep model selection and cost attribution intact. Secrets are configured through deployment tools, never copied into source or documentation. Kody OAuth authorizes an integration attached to the TanStack user. It does not replace the site's login flow.
+
+Native shell naming is TanStack. Its production destination is `https://tanstack.com/chat`. Audit app identifiers, updater origin, signing, deep links, native folder permissions, connected-device authorization, and release channels separately. Changing the window title is not a complete desktop port.
+
+## Implementation sequence
+
+1. Record the source capability inventory, current destination builder behavior, destination branch state, and sibling ownership. Freeze the standalone hosting plan. Do not deploy a proxy back to the personal Gum account as the final architecture.
+2. Establish `/chat` layout and route ownership in the destination. Reuse site auth and prove signed-out, signed-in, revoked-session, and forbidden-capability behavior. Use actual TanStack user IDs from the outset.
+3. Define Drizzle chat tables and implement the source persistence operations using Postgres transactions and constraints. Port SQLite-specific statements explicitly, including conditional updates, deduplication, claims, and optimistic versions. Keep Durable Object-local SQLite where execution needs it. Add no old-data import path.
+4. Add the execution objects, durable streams, R2 storage, Workflows, AI, Gateway, and scheduled recovery to TanStack infrastructure and type generation. Integrate the existing server runtime and cron dispatcher. Prove bindings locally before production.
+5. Port the ordinary conversation loop and its UI, including cancellation, queue state, approvals, files, threads, context rules, and truthful error status. Replace or reuse destination primitives individually. Scope chat CSS and theme state so they do not alter marketing, documentation, or the design-system pages.
+6. Port remaining MCP, Kody, skills, memory, routing, models, usage, workflow, schedule, sharing, device, and desktop capabilities. Keep generic tool contracts and do not add task-specific routing.
+7. Extract and reuse the builder's execution, sandbox, preview, project, and deployment capabilities through the new harness. Retire its separate assistant loop and chat state. Determine which shared-example/chart routes remain dedicated tools before redirecting `/builder`. Old private project records do not need migration, but public documentation and embedded examples still need a working route.
+8. Scope all chat endpoints, links, OAuth callbacks, assets, manifests, service workers, and desktop navigation. Source root assumptions such as `/api`, `/auth`, and service-worker scope `/` cannot be transplanted unchanged. Put chat-specific APIs under `/api/chat`; reuse existing site auth routes. Chat service workers must not intercept the rest of TanStack.
+9. Run destination checks and an authenticated live browser parity matrix. Release through the existing TanStack pipeline. Only then activate `/builder` and subdomain redirects. Record the deployed revision, resource ownership, rollback, and remaining experimental limitations.
+10. Retire the old standalone app and obsolete branding, duplicate auth, builder harness, and unused dependencies after verified cutover. Do not delete independent example infrastructure that still has consumers.
+
+## Verification matrix
+
+Every capability gets source location, destination location, status, tests, and browser evidence. Completion requires all of these gates:
+
+- `/chat` works through direct navigation, reload, deep links, and local development.
+- Site sign-in is reused, including session revocation and access checks. Kody disconnect does not sign the person out of TanStack.
+- Ordinary tasks use a real configured model; fixtures cannot be mistaken for production inference.
+- Streams reconnect and resume, long histories tail efficiently, forks and threads retain their context semantics, and queues stop without duplicate actions.
+- Approvals, files, retry behavior, and tool execution retain their security and correctness contracts.
+- Integrations and skills are discoverable without requiring the person to name internal tools.
+- Model and tool usage are attributed to the correct TanStack user and account. Model accuracy is an observation, not a harness pass/fail gate.
+- Existing site pages, login, shared examples, and documentation embeds still work.
+- Native TanStack opens Chat and its device, folder, signing, and update flows work.
+- `/builder` redirect behavior is defined per route, and `chat.tanstack.com` preserves valid chat deep links without forwarding credentials.
+- Cloudflare bindings, storage, secrets, gateways, and release ownership are in TanStack infrastructure. No production dependency remains on the personal Gum account.
+- Required tests, type checks, build, and live smoke checks cover the deployed revision, not just the source branch.
+
+## Open decisions to resolve from code
+
+Builder public examples and charts must be classified before redirecting all `/builder` paths. The auth capability that grants chat access, account budget defaults, and model availability must match TanStack's existing authorization and billing design. Desktop app identity and updater changes require coordination with the Electron work. Confirm whether the user means the existing `tanstack.com` checkout or a new `tanstack` repository before any repository move. Current working assumption is the existing website checkout because it owns the requested auth, backend, and URL.
+
+## Implementation evidence, September 30
+
+The first destination slice adds `chat_workspaces`, `chat_memberships`, `chat_bots`, and `chat_conversations` to the shared Drizzle schema. All user references point to TanStack's existing `users` table. `/api/chat/workspace` validates the existing TanStack session, checks the existing builder/admin capability, uses the existing same-origin boundary, and opens the personal workspace in one transaction. This is not a complete `/chat` frontend or harness port yet.
+
+Migration `0002_tanchat_account_workspace.sql` was generated and applied only to a temporary local Postgres database. Eight concurrent opens through the actual persistence function produced one personal assistant. A second user received separate records. The database rejected archiving the personal assistant and rejected a parent from another workspace. Destination TypeScript and type-aware lint passed for this slice. Production migration, full suite, frontend, execution bindings, and deployment remain pending.
+
+The [source schema inventory](tanchat-source-schema.json) was produced by applying all 55 source migrations to in-memory SQLite and inspecting the resulting schema. It contains 71 D1 tables, including columns and foreign keys. It is an inventory, not a converted Postgres schema. Conversation Durable Object-local schemas and R2 contents need separate inventory.
+
+## Neon decision and conversation operations
+
+Keep TanStack's Neon Postgres for shared account data. The sponsored account is currently free. Keep Durable Objects for execution and conversation-local streams, and R2 for files. Audit Cloudflare's actual bill before attributing the reported $250 monthly total to database usage. Do not move the site's database to D1 as part of this consolidation. Evaluate Hyperdrive for connection pooling only against measured latency and consistency needs.
+
+The destination now has validated provider policy, TanStack server functions for opening a workspace and creating conversations, and atomic bulk archiving. Bulk archive checks the complete requested set, locks both membership and conversation records, and rejects the personal assistant. Invalid or inaccessible IDs cause the entire transaction to roll back. The repeatable local Postgres check is `scripts/verify-tanchat-workspace.ts`; it requires an empty local database named `tanchat_test*`. It checks eight concurrent opens, user isolation, assistant protection, cross-workspace parents, bulk failure atomicity, duplicate IDs, and archived-item filtering. Source rendering and the full agent loop remain to port.
+
+### Conversation and thread context port
+
+Main conversations now have explicit mappings, rather than limiting each assistant/user pair to one conversation. Conversation lookup checks workspace membership and the conversation owner, including when a caller supplies an exact conversation ID.
+
+Thread storage keeps the existing bounded source snapshot contract, including source epoch, digest, text excerpts and file references. Composite foreign keys require the child and parent to belong to the same assistant and user. Stored context is evidence and does not grant access to referenced files. Context reads validate the snapshot and authorize the child conversation first.
+
+An isolated local Postgres check applied migrations 0002 through 0004 and verified main lookup with another conversation present, exact thread lookup, cross-user rejection, snapshot reads, and rejection of cross-account parent links. Typechecking passed. These migrations have not been applied to production.
+
+Thread creation still needs the Durable Object source-message verification and idempotency protocol. No client API accepts an unverified snapshot. The complete UI, agent execution loop, integration storage, and builder replacement remain unfinished.
+
+Thread creation now has a Neon transaction and idempotency receipts. It locks the assistant and membership, rechecks active main-conversation admission, enforces the 100-thread limit, and creates conversation, snapshot and receipt together. The internal capture dependency must be connected to the authoritative Durable Object before a browser route is exposed. Eight concurrent identical requests produced one thread in local Postgres; retries reused the receipt without recapturing, changed-message reuse failed, and threads could not act as main parents. Typechecking passed. Runtime capture wiring remains pending.
+
+### Direct core port
+
+All 107 existing source core modules were copied into src/chat/core. 106 are byte-for-byte identical; types.ts now references the extracted MCP contracts in core rather than server modules. The contracts themselves were copied from the source interfaces. docs/tanchat-core-port.json records source and destination hashes for review. The persistence layer now reuses the full original thread and reference schemas instead of separate subsets.
+
+38 existing core test files passed, 560 tests. Two additional copied tests need the conversation runtime fixtures and remain under harness-tests/pending-runtime until that runtime is ported. The harness tests use Vitest, matching the source project, and run through test:chat as part of the destination test command. Like the destination's existing tests, they are excluded from the application TypeScript build. The application typecheck passed after dependency alignment.
+
+### Streams and transcript archive
+
+Copied conversation-events.ts and stream-append.ts unchanged into src/chat/server. Copied transcript-archive.ts with an explicit Cloudflare SqlStorage type import, and conversation-stream.ts with explicit DurableObjectState and DefaultAuthEnv types. The stream handler retains the source createStreamsHandler options and default authentication behavior, and remains internal-only, with no public route mounted. No always-allow authentication callback was added.
+
+The existing conversation-events and transcript-archive tests were carried over. The complete runnable harness suite now passes 578 tests across 40 files. This covers event projection and archived history operations, but does not yet prove deployment bindings or live stream reconnection. Durable Object wiring and public authenticated endpoints remain pending.
+
+### MCP transport and discovery port
+
+Copied the existing MCP client/session transport, catalog collection and cache logic, assistant discovery middleware, assistant MCP tools, crypto helpers, and paired-discovery contract into src/chat/server. Only .ts import suffixes were removed where required by the destination TypeScript configuration. The core MCP contract exports now point to the actual ported server interfaces, avoiding duplicate declarations. Added the existing MCP catalog, session, and referenced-tool tests. All 613 runnable harness tests pass across 43 files. Account credential persistence and host wiring remain pending; this does not make a connected integration available in the destination UI yet.
+
+### Assistant behavior and system-one loop
+
+Copied assistant-instructions.ts, assistant-capability-guidance.ts, stored-results.ts, system-one-loop.ts, and catalog-evidence.ts from the source. Source instruction text and execution logic are retained. Kody suggestion types were extracted from the source catalog interfaces into core/kody-suggestions.ts so instruction assembly does not import unported D1 persistence. Server provenance is recorded in docs/tanchat-server-port.json.
+
+The existing assistant-discovery, stored-results, and system-one-loop tests were carried over. The runnable harness suite passes 653 tests across 46 files. The Cloudflare adapter is pinned to the source's working 0.1.5 version; the newer adapter selected by a version range required a different TanStack AI API. Application typechecking passed. Complete runtime orchestration, credentials and provider binding remain pending.
+
+### Provider and usage port
+
+Copied the source provider adapters, Gateway routing, Cloudflare model compatibility, public endpoint validation, request-shape observation, provider token totals, usage cost logic, and Durable Object usage ledger. Runtime binding types are explicit; the source's global Env augmentation was not brought into the website. ProviderEnv describes the actual AI binding and Gateway settings needed by these modules.
+
+Preserved TanStack's existing OpenAI and Anthropic dependencies, including its patched OpenAI tool continuation. Added missing Gemini, Groq, Grok and Vercel adapters at source versions. Seven existing provider and usage test files were carried over. All 764 harness tests pass across 53 files, including controlled adapter responses and ledger accounting. This does not yet prove real inference through deployed bindings. Model selection, account credential persistence and usage receipts in Neon remain to wire.
+
+### Dependency-complete runtime port
+
+Ported another 30 existing server modules whose dependency graphs are complete in the destination, including MCP task hosting and OAuth discovery, paired Kody inventory/discovery, Kody action and code validation, delegation tools, connection/workspace/schedule tools, context and message history, and progress/error handling. Source behavior was preserved, with only TypeScript import suffix adjustments. Standalone auth popup and development backend modules were deliberately excluded because site auth and runtime replace those boundaries.
+
+42 additional existing test files were carried over. All 1,156 runnable harness tests pass across 95 files, and application typechecking passes. Babel parser/types were added at the source versions for existing code-contract validation. Shared-database modules, the main Conversation Durable Object, frontend components, infrastructure bindings and deployment still require porting. Passing these tests does not prove full runtime parity or cutover.
+
+### Credential persistence boundary
+
+Ported readCredentials, writeCredentials and updateCredentials from source auth.ts into a dedicated destination credentials module. Only persistence changed from D1 to Drizzle/Postgres. The source AES-GCM seal/unseal helpers and eight-attempt compare-and-swap protocol remain in use. Credentials reference the existing TanStack user table, and no standalone session or sign-in system was copied.
+
+Migration 0006 was applied only to isolated local Postgres. Synthetic test credentials verified encrypted-at-rest storage, wrong-key rejection, account isolation, and preservation of two simultaneous provider edits. Existing workspace/thread/archiving checks passed in the same database. Application typechecking passed. Runtime secret provisioning and authenticated settings endpoints remain pending; no real account keys were copied or production schema changed.
+
+### Account preferences
+
+Adapted the source account-preferences persistence to Neon while retaining the original validation schemas, default appearance/response settings, shared optimistic revision, omitted-field preservation, no-op behavior, and timezone confirmation rules. Added server functions using existing TanStack auth and CSRF protection, taking the account ID only from the authenticated session.
+
+Migration 0007 was verified in isolated local Postgres. Checks covered default snapshots, preserving response preferences while changing timezone, no-op revision stability, stale edit rejection, one winner among concurrent edits, and user isolation. The database test caught and corrected an extra userId in a returned snapshot. Application typechecking passed. Preferences are not wired to the new UI yet, and production remains unchanged.
+
+### Conversation memory persistence
+
+Adapted source memory.ts from D1 guarded batches to Neon transactions. Retained the source command/list schemas, conversation-only scope, provenance, idempotency digest and historical receipts, no reuse of deleted memory identities, revision checks, expiry filtering, recall defaults, and archived/deleted access distinctions. Transactions lock the conversation, assistant and membership before mutations, and thread lifecycle records where present. Copied assistant-memory-tools.ts with only its database constructor dependency removed.
+
+Migration 0008 was verified in isolated local Postgres. Checks include eight concurrent identical creates, replay conflicts, cross-user denial, stale updates, delete/read behavior, deleted-ID reuse rejection, expired create rejection, recall preference revisions and archived-chat write rejection. Existing credential/preferences/thread/workspace checks passed in the same database. Application typechecking passed. No public memory API or conversation runtime is wired yet, and production is unchanged.
+
+### Composer drafts
+
+Adapted the source composer-drafts.ts persistence to Neon, preserving person/scope ownership, optimistic revisions, empty-value tombstones, no-store responses and stale-write rejection. Added /api/chat/draft using existing TanStack session/capability checks, same-origin mutation validation, bounded JSON body reading and validation errors. The route was registered with the router generator.
+
+Migration 0009 was tested only in isolated Postgres. Two concurrent initial writes produced one winner, clearing a draft retained its revision, stale text could not resurrect the cleared value, and another user saw a separate empty draft. The existing workspace/thread/credential/preferences/memory checks also passed. Live route authentication and frontend draft synchronization remain pending, as do the larger runtime/UI cutover requirements.
+
+### Conversation-local storage and supporting runtime
+
+Copied 17 existing conversation-local SQLite modules, including execution sessions, run state, schedules, delegation admission and waits, workflow state, saved results, ordered history, MCP sessions and conversation copy storage. These retain Durable Object storage and original behavior, with explicit Cloudflare type imports where the website requires them. Existing SQLite fixtures and tests were carried over.
+
+Also copied assistant schedule policy, conversation run projection, history tools and workflow input handling with their existing tests. The source provenance manifest now covers 79 server modules, including adapted persistence boundaries. Application typechecking passes and all 1,324 harness tests pass across 110 files. These are module-level checks, not evidence of complete live runtime or UI parity. Main Conversation Durable Object wiring, shared persistence still missing from the inventory, frontend, infrastructure and deployment remain required.
+
+### Saved-file contract preparation
+
+Extracted the existing saved-file validation and record contract from source saved-files.ts into saved-file-contract.ts, with the original service importing and re-exporting it. Copied that module unchanged into the destination. No validation or file behavior was rewritten. Source saved-files and draft-files suites passed all 63 tests after extraction.
+
+The remaining persistence port must retain quota reservation, immutable R2 payloads, checksum verification, pending receipts with resumable identical retries, current-access checks before publication, draft attachment and copy/import provenance. The shared contract alone does not provide destination file persistence or connected file tools.
+
+### Saved-file Neon schema
+
+Added chat_file_drafts, chat_bot_drafts, chat_saved_files and chat_saved_file_imports to the shared schema and generated migration 0010. Composite foreign keys bind conversation files and first-send receipts to their actual bot/account/workspace. Draft and conversation scope are mutually exclusive. File size, name, digest, source and state have database constraints. Import provenance does not reference the source file with a cascading foreign key, preserving independent completed copies.
+
+Ported the source immutable-file and import-receipt triggers to Postgres. Draft promotion requires a matching first-send receipt, current active conversation/membership, ready selected attachments, and conversation quota. It locks the conversation, bot and membership while checking promotion. Metadata cannot change and ready state cannot revert.
+
+The full migration chain through 0010 passed in a fresh isolated local database. Checks covered invalid cross-account file scope, metadata/import immutability, unauthorized promotion rejection, authorized promotion, rejection of a second scope move, and monotonic ready state. Existing workspace, thread, credential, preference, memory and draft checks passed too. Application typechecking passed. The local database server was stopped. No production migration was applied. File service persistence and R2 publication still need wiring and concurrency verification before this can be used by the destination runtime.
+
+### Saved-file service port, first transaction boundary
+
+Ported the FileStore save/list/get/content/text paging behavior to Neon. Scope authorization and quota reservation share a Postgres transaction that locks the conversation, bot, membership and existing thread lifecycle. Pending receipts count against quota. Publication rechecks authorization and receipt ownership after immutable R2 upload/checksum verification. Normal saves cannot adopt import-reserved IDs. Repeated identical saves resume pending uploads, different bytes or metadata fail, and account access is checked on reads.
+
+Copied the original verified-byte reader and same-conversation copy method, retaining abort handling and source rechecks before and after delivery intent. R2 native conditional options replace the equivalent If-None-Match header, and native arrayBuffer replaces DOM Response construction to avoid incompatible Worker/DOM type declarations. The copied byte allocation has an explicit ArrayBuffer generic.
+
+Fresh isolated Postgres checks passed for eight concurrent identical uploads, one immutable payload, changed-content rejection, failed-upload receipt recovery, account isolation, text paging, verified copy and same-ID rejection. Existing migration and persistence checks also passed. Application typechecking passed after the buffer type adjustment. The local database was stopped. Cross-conversation import, draft upload/promotion services, file APIs and assistant file tools remain to port, so this is not complete file-runtime parity. No production deployment or migration occurred.
+
+### Cross-conversation imports and draft file service
+
+Ported cross-conversation file imports to Neon transactions while retaining exact source bindings, frozen metadata, abort handling, verified bytes, import quotas, rejection of ordinary saves into reserved import IDs, and independently owned completed copies. Every file transaction takes the account/workspace membership lock before conversation locks, so reciprocal imports use consistent ordering. Access is checked again at reservation and publication. A completed import can be replayed after source deletion; a new import cannot use the deleted source.
+
+Ported DraftFiles and resolveDraftAttachments with original limits and read-only empty draft behavior. Replaced D1 promotion statements with promoteDraftFiles, called inside the caller's first-send transaction. Existing database triggers enforce the receipt, selected attachment readiness, authorized scope transition and quota. Every staged file moves, including unfinished uploads that remain resumable in the destination conversation.
+
+Copied assistant-file-tools.ts byte-for-byte and carried over its 22 existing tests. Added the website source alias to the harness test configuration. All 1,346 harness tests pass across 111 files. Application typechecking and targeted lint pass.
+
+Fresh isolated Postgres checks passed for concurrent import idempotency, source-binding conflicts, failed-import recovery, reserved-ID protection, completed-copy independence, reciprocal imports, read-only empty drafts, pending attachment rejection, promotion of ready and pending files, sent-draft denial, resume after promotion, and the 20-unsent-draft limit under 22 concurrent uploads. Existing persistence checks passed as well. The first import test run had an invalid synthetic integer timestamp, corrected to now(); the corrected full check passed. No production schema or deployment changed. File routes and first-send runtime integration remain pending, as does the main conversation runtime/UI/infrastructure cutover.
+
+### Authenticated file HTTP boundary
+
+Ported file-api.ts with the original bounded upload reader, metadata/content behavior, media type handling, private no-store headers, safe attachment filenames, text preview restriction and sandbox headers. Copied its seven existing tests. The FileEnvironment runtime boundary now uses native readable streams, consistent with the site's existing blob-storage boundary, instead of importing Cloudflare's conflicting stream declaration into DOM Response construction.
+
+Added /api/chat/files with existing TanStack session/capability checks and same-origin PUT validation. The route takes the account ID only from the authenticated session. Query validation requires a workspace and either draft scope or a bot/conversation scope, rejects mixed scopes, and requires valid UUIDs for file operations. File-service errors return their actual status. The route was registered using the installed router generator.
+
+getFileEnvironment reuses the existing BUILDER_PROJECTS R2 binding, tanstack-notebook-projects, with immutable saved-files/ keys. Existing builder snapshots use projects/v1/ keys, so no builder storage behavior or existing keys changed. Missing runtime storage returns 503 rather than silently substituting local data. This reuse does not create a new bucket or incur a separate provisioning requirement.
+
+Seven route checks verify missing sessions, capability denial, session-derived ownership despite a forged query user ID, cross-origin uploads, invalid/mixed scopes and storage failures. All 1,360 harness tests pass across 113 files. Application typechecking and targeted lint passed. Live authenticated HTTP access and deployed R2 reads remain unverified. The frontend, first-send flow, full conversation runtime, deployment and builder replacement remain pending. No production changes were made.
+
+### First-send receipt and atomic creation boundary
+
+Added the original draft receipt fields for first message text, parent, model selection, references and started state, plus the source's unique bot-to-first-send receipt constraint. Migrations 0011 and 0012 remain local.
+
+Ported the persistence portion of source BotDrafts.start into BotDrafts.reserve. It reuses botDraftInput, draftBotName, model/reference schemas and replay comparisons. A transaction locks membership, rechecks a winning receipt, validates an active same-workspace parent, checks selected files under the same transaction, inserts the bot/conversation/main mapping/receipt and promotes all staged files. A rejected request cannot leave an orphan chat. Replay returns the frozen receipt without rerunning preparation. The internal prepare dependency must be connected to the original model/reference/attachment validation before this is exposed publicly. Runtime begin and started-state acknowledgement are not implemented by this reserve method.
+
+The full migration chain through 0012 passed in a fresh isolated local database. Eight concurrent first sends produced one chat; eight first sends with the same attachment produced one chat and one scope promotion. Checks also covered changed-input rejection, no preparation on replay, foreign-parent and account denial, and no orphan chat/receipt for a pending selected attachment. Existing persistence/import/draft checks passed. Application typechecking and targeted lint passed. The local database was stopped. Actual model execution, first-send API/UI, complete runtime wiring and production cutover remain pending.
+
+### Original model resolution and attachment preparation
+
+Copied run-models.ts, model-attachments.ts and attachment-request.ts. Model catalog contents, configured-provider resolution, workspace policy enforcement, endpoint validation, reviewed reasoning levels, vision/PDF support, attachment budgets, saved snapshot checks and provider message preparation remain the original code. Changed the credential import from standalone auth to the ported shared-account credentials module and replaced the standalone Env type with explicit ModelEnvironment/AttachmentEnvironment dependencies.
+
+Copied the original run-model and model-attachment test suites, changing their credential mock path to the new persistence module. All 1,409 harness tests pass across 115 files and application typechecking passed. These checks exercise deterministic harness behavior with controlled responses, not model efficacy. Actual inference, shared-runtime secret provisioning, model API/UI and integration into first-send preparation remain pending.
+
+### Authenticated model catalog and policy reuse
+
+Added /api/chat/models, registered through the router generator, using the existing TanStack session and builder/admin capability. The catalog takes account identity from the session and reads policy only through that account's workspace membership. The endpoint always uses real-model mode, never a client-selected fixture mode. Responses contain model selection metadata only, with private no-store caching.
+
+ModelEnvironment reads INCLUDED_MODEL and ENCRYPTION_KEY from the shared runtime environment or the site's local process environment. Missing configuration produces an explicit 503; no keys or model defaults were invented and no production secrets were provisioned. Replaced the initial duplicate chat policy definition with re-exports of the original core policy schema/default/type, retaining one authoritative policy definition.
+
+Six route checks cover authentication, capability, workspace selection, session-derived identity, forced real-model mode, inaccessible workspaces before credential lookup, secret isolation and missing configuration. All 1,415 harness tests pass across 116 files. Application typechecking and targeted lint passed. Actual workspace policy reads and cross-account denial passed in fresh isolated Postgres along with the full persistence checks; the local database was stopped afterward. Live model catalog access, secret provisioning, real inference, frontend, main Durable Object runtime and production cutover remain pending.
+
+### Private skill persistence
+
+Ported source skills.ts to Neon transactions and added chat_skills, chat_skill_versions and chat_skill_commands in local migration 0013. Original validation schemas, cursor decoding/filter binding, metadata-only listing, canonical request/content hashing, pinned version inspection, archive/restore/enable behavior and historical command receipts are retained. Membership locks serialize scoped writes and quota checks. Postgres transactions replace the D1 nonce/guarded-batch protocol. Global ID collisions return a conflict rather than adopting another account's record.
+
+The complete migration chain through 0013 passed in fresh isolated Postgres. Checks covered eight identical creates, changed-command replay rejection, version history and old receipt replay after update, stale revisions, archived edit/resolve rejection, restore remaining disabled, re-enabled pinned-version resolution, private scope, metadata pagination and filter-bound cursors. The 200-skill limit includes archived skills. A test-only version-write failure rolled back the skill and command receipt, and retry after removing the failure succeeded. This injection existed only in the isolated test database.
+
+Application typechecking and targeted lint passed. The local database was stopped. Combined local/Kody skill catalog, selected-skill preparation, skill tools/API/UI and the main runtime remain to wire. No production schema, skill content or deployment changed.
+
+Kody token renewal now uses Neon refresh claims. This is a direct port of the source renewal protocol, including the rule that an expired lease cannot consume the same refresh token again. Migration 0014 is local only. OAuth account linking and the combined skill catalog still need wiring and live verification.
+
+Isolated Postgres verification passed for Kody renewal: eight concurrent callers made one refresh request, all received rotated credentials, stale readers could not reuse an expired refresh lease, rejected grants were not retried, and sign-in status reflected the saved rejection. Test transport responses were simulated, so this does not prove live Kody OAuth connectivity. Verification: scripts/verify-tanchat-kody-refresh.ts.
+
+Ported Kody account discovery and memory search from source, retaining bounded projections and request timeouts. Workspace authorization now uses the existing shared policy reader. Seven original projection tests and isolated Postgres membership/disconnected-account checks passed. No live OAuth or frontend wiring is implied.
+
+Ported Kody reference account checks, run inspection, bounded resource projections, and fresh MCP handshake guidance. Account subjects are now represented in local migration 0015, attached to existing TanStack users. These modules retain the source account-change recheck after remote reads. OAuth link creation, catalog synchronization, and runtime/UI integration remain incomplete.
+
+Catalog synchronization prerequisites now include Neon account-bound snapshots, historical skill versions, revision leases, and staging rows in migration 0016. The source catalog fingerprint protocol is ported in kody-skill-account.ts, including membership, policy, connected subject, and fallback token binding. The actual collector and atomic sync publication are still pending, these prerequisites do not constitute a functioning synchronized catalog.
+
+The original Kody skill collector is ported into kody-skill-source.ts, preserving inventory validation, paired list/get exports, bounded pages, stable index fingerprints, companion files, and three-registry concurrency. Three checks using the original catalog fixtures passed, including rejection of inconsistent page counts and foreign-package documents. Typechecking and lint passed. Atomic Neon publication and catalog readers remain pending.
+
+Ported source catalog synchronization to direct Postgres queries and atomic publication. Isolated Postgres verified snapshot publication, preserved companion files, fresh-cache lease exclusion, and staging cleanup using original collector fixtures. Typechecking and lint passed. Failure rollback, competing revision takeover, catalog readers, and live integration remain to verify or implement.
+
+Ported catalog readers and original skill ranking. Isolated Postgres checks passed for ready cache reads, pinned inspection, companion file retrieval, ranked suggestions without new remote calls, and preserving the previously published snapshot after collector failure. Typechecking and lint passed. Combined local/Kody catalog, OAuth account linking, main runtime, UI, and live cutover remain incomplete.
+
+The combined catalog requires private installed plugins as well as saved and Kody skills. Ported the source plugin schema to local migration 0017, retaining immutable-version storage, package files, stable skill identities, MCP bindings, and command receipts. Source plugin scope/error/version-pin contracts are ported in plugin-contract.ts. The plugin service and combined catalog are still pending, no plugin namespace has been dropped as a shortcut.
+
+Ported private plugin package reads and original package validation into plugin-packages.ts, including retained-version metadata authorization, supported-component checks, file reads, and repeated membership checks. Typechecking and targeted lint passed. These read paths still require Postgres behavior checks. Installation commands, plugin skill listing, MCP bindings, combined catalog and main harness wiring remain pending.
+
+Isolated Postgres checks passed for plugin package validation, private account reads, retained-version inspection, file retrieval, and denial after disabling/removing an installation. Plugin skill inspection and exact-version resolution are now ported from source, with typechecking and lint passing. Skill-specific Postgres checks, listing, install/update commands, and combined catalog wiring remain pending.
+
+Plugin skill listing now retains original version-pin and cursor behavior. Isolated Postgres checks passed for skill inspection/resolution, listing, exact pins, missing-version denial, and disabled omission/use denial. The original three-namespace SkillCatalog is ported, with constructor/storage imports adapted. Combined pagination behavioral verification, plugin commands/MCP bindings, assistant tool wiring and main runtime remain pending.
+
+Original assistant skill tool definitions now use the ported three-namespace catalog. Isolated Postgres checks verified single-item pagination through private/plugin/Kody skills, external-only listing, exact plugin resolution, actual read_skill execution and its onRead task-pin callback. Typechecking and targeted lint passed. Tool registration in the main Conversation runtime, browser skill UI, plugin write lifecycle and live deployment remain incomplete.
+
+The original bounded skill HTTP adapter is ported and registered at /api/chat/skills behind existing TanStack authentication, builder/admin capability, workspace membership, and same-origin mutation checks. Four route boundary tests passed, along with typechecking and targeted lint. This does not verify a live deployed endpoint or browser UI. Main runtime/UI, plugin writes, OAuth setup and deployment remain pending.
+
+MCP account storage prerequisites are now ported in local migration 0018, including private accounts, encrypted secret envelopes, OAuth grant/token revisions, refresh claim fencing, and command receipts. Original account scope/error/OAuth/refresh result contracts are ported in mcp-account-contract.ts. The source legacy account importer is intentionally outside this fresh-start consolidation, no existing private data migration is requested. Actual account read/write/refresh services and OAuth setup remain pending.
+
+Ported MCP account reads with original encrypted envelope identity checks and post-read grant/token/revision fences. Isolated Postgres verified private metadata, credential decryption, configured/runtime server projection, foreign membership denial and reconnect-state omission. Typechecking and lint passed. Account mutation/refresh/OAuth setup, plugin bindings, main runtime/UI and deployment remain pending.
+
+Ported original MCP save/enable/disconnect/remove and OAuth-begin mutation calculations to Neon transactions. Per-user locks protect account-wide command replay and quota, transaction-local membership/policy locks preserve access. Isolated Postgres checks passed for eight concurrent identical commands, changed-command rejection, enablement revision updates and stale revision denial. OAuth token installation/refresh and live setup remain pending.
+
+MCP OAuth completion and refresh storage are ported from source. Isolated Postgres checks passed for duplicate callback replay, eight concurrent refresh contenders with one owner, rotated token publication, completion replay and stale-claim denial. Typechecking and lint passed. Live OAuth network/setup endpoints, plugin mutation/bindings and full main runtime/UI remain incomplete.
+
+Ported original MCP account runtime refresh/check flow and trusted public egress selection. Ten original egress tests passed, targeted lint/type analysis passed after adapting optional environment fields. The original build-time local-development assertion is retained, but Vite companion wiring remains pending, so local remote requests fail closed unless an explicit companion is configured. Live OAuth refresh, setup endpoints, plugin writes and main runtime/UI remain incomplete.
+
+Ported plugin install/update/enable/remove/restore/bind command calculations to Neon transactions, retaining package digest review, stable skill identities, immutable versions, exact binding endpoint validation and command replay. Isolated Postgres verified eight concurrent installs, replay conflicts, updates retaining skill identities, old file versions, remove/restore disabled state. Typechecking and lint passed. Binding concurrency, write-failure rollback, plugin quota and HTTP/runtime integration still need verification or wiring.
+
+Ported plugin installation listing, metadata-only skill discovery, original task version-pin authorization, assistant plugin tools, and bounded plugin HTTP adapter. Postgres checks verified installation search and skill metadata alongside the prior lifecycle suite. Typechecking and type-aware lint passed. The HTTP adapter is not yet registered on an authenticated route, and tools are not yet registered in the main Conversation runtime. Full runtime/UI, OAuth setup and deployment remain incomplete.
+
+Registered /api/chat/plugins through existing site authentication/capabilities, workspace membership and same-origin mutation checks. Four route tests and three optional-Kody environment checks passed. Fixed optional-Kody environment projection to retain configured encryption keys for independent integrations. Isolated Postgres failure injection verified that a failed plugin version write leaves neither installation nor command receipt, and the same command can subsequently succeed. Typechecking and targeted lint passed. Browser/main runtime and production cutover remain pending.
+
+### MCP setup source port
+
+Ported Gum's `src/server/mcp-setup.ts` directly into `src/chat/server/mcp-setup.ts`. Replaced its D1 queries with scoped PostgreSQL queries and reused the existing Neon workspace policy service. The source OAuth state, encrypted envelope, browser nonce, issuer verification, reviewed scope checks, single-use callback claim, account revision checks, and failure cleanup remain intact. Migration 0019 stores these setup attempts. Targeted lint passed. The original SQLite-backed integration tests still need adaptation to the actual PostgreSQL service before this port is considered verified. No production migration or deployment has been performed.
+
+MCP setup PostgreSQL verification now passes in an isolated local database: published review, identical replay, conflicting request rejection, account isolation, mismatched origin denial, initialize-only public MCP connection completion, completed setup replay, and expiration. The combined workspace/service verifier also passed. These tests use a synthetic MCP endpoint, no external account or production storage. OAuth callback and concurrent setup limit cases still need coverage, and routes are not mounted yet.
+
+Ported the original MCP account/setup API adapter and OAuth callback handler into `src/chat/server/mcp-account-api.ts`, preserving bounded request bodies and error responses. OAuth callback lookup uses Neon and existing TanStack sessions, including the site's chat capability gate. Added an MCP runtime environment loader that keeps public egress enforcement intact. These handlers still need route mounting and route tests, they are not exposed in production.
+
+Mounted `/api/chat/mcp/*`, `/auth/mcp/callback`, and the public OAuth client metadata endpoint. The API uses existing session identity and chat capability access, checks workspace membership, rejects cross-origin mutations, and translates bounded-input validation errors. Four route authorization tests passed. OAuth returns now point into `/chat/w/...`, the eventual mounted chat UI. Production deployment and end-to-end OAuth remain unverified.
+
+Setup publication now locks the account row and rechecks replay and the 20-attempt quota in the same PostgreSQL transaction. A 24-request parallel test verified the cap without blocking network discovery inside the transaction. The combined PostgreSQL verifier passed. Source hashes for MCP setup and API ports are recorded in the server provenance manifest.
+
+Ported original workflow file-input reader, virtual input result store, task skill version activation, browser execution gate, and Kody assistant discovery. The workflow and discovery modules remain byte-identical; task skills and browser gate only adapt environment types. Four original test files passed, 14 tests cover predecessor file identity/access checks, read-only virtual references, browser execution restrictions, and independent cached skill/action discovery. The conversation runtime itself is still not mounted.
+
+Ported Kody run-history projection and assistant tool with original tests, five checks passed. Ported answer evidence selection with the source ai-typesafe 0.1.1 adapter, seven original checks passed. Ported message attachment resolution, adapting only the file environment type. These are conversation runtime dependencies, the main runtime remains outstanding.
+
+Ported original discovery-model interpretation, Jev routing, tool proposal/ranking, research loop, and Kody system-one answer execution. Only environment types were adapted. Original discovery schema, ranking, and routing tests passed, 28 checks total. No live model calls were made by these tests. The full conversation Durable Object, frontend, and infrastructure cutover are still required.
+
+Ported Kody memory reads, reviewed memory creation, assistant memory tools, synced skill lookup, and the Jev task decision dependency tree. Adaptations are explicit environment types and extensionless imports for the destination TypeScript configuration. Four original Kody test files passed (15 checks), and the original task decision suite passed (13 checks). Type checking passed. No live remote writes or model calls occurred. Main Conversation runtime and UI remain outstanding.
+
+Ported connected MCP server projection, plugin-bound connection lookup, and Kody setup readiness from source. Workspace policy and plugin metadata SQL now use Neon. Plugin lookup retains pinned versions, endpoint matching, credential metadata, and its post-hash access recheck. Three original setup readiness checks passed. The adapted plugin SQL and full connection composition still need PostgreSQL integration verification before considered verified.
+
+Plugin connection PostgreSQL integration now passes: package installation and binding through actual command services, exact alias lookup, unavailable pinned-version exclusion, foreign-account denial, combined MCP projection, and disabled-package denial. The full isolated workspace/service verifier passed. No remote requests or production writes were needed for this metadata test.
+
+Ported workflow execution context and owner authority from source. Context joins now use Neon, including current membership, active bot/thread, same-bot child access, and policy recheck after model lookup. Type checking passed. The isolated PostgreSQL verifier passed a real included-model configuration lookup, foreign-account denial, and unrelated-child denial. Full workflow dispatch and authority journal integration remain unverified until the Conversation runtime is mounted.
+
+Ported the complete original discovery-integrations directory unchanged. Its explicit MCP integration registry, Kody inventory projection, discovery response interpretation, and action contract parsing are preserved. Three original suites passed, 33 checks total. These checks verify parsing and behavior with synthetic responses, not live Kody availability. The remaining runtime dependencies include conversation lifecycle/copies, execution authority, activity/sync, workflows, device access, and message references before the main Conversation port can be completed.
+
+Ported source workflow definition persistence to Neon with scoped reads, bounded latest-revision pagination, immutable revision/retry receipts, and serialized competing writers. Migration 0020 preserves the source database authority, sequential revision, and update immutability guards. The service and migration still require PostgreSQL integration verification, no production migration has been applied.
+
+Workflow PostgreSQL verification passed: eight concurrent identical commands return one revision receipt, conflicting inputs fail, prior revisions remain readable, stale edits fail, archive produces the next immutable revision, foreign accounts cannot read, direct updates fail, and skipped revision inserts fail. Fixed a PostgreSQL ORDER BY ambiguity found by the retained-revision check. The combined service verifier passed; no production migration applied.
+
+Ported the original assistant workflow tools. Adapted the Workflows constructor to shared persistence and declared an explicit runtime interface for the Conversation RPC methods. Type checking and three boundary checks passed: non-user tasks receive no tools, task identity gates writes/launch, and repeated definitions use identical workflow/command identities without starting a runtime. Full original runtime integration tests remain dependent on the main Conversation port.
+
+Ported exact workflow child publication and admission storage (migration 0021). PostgreSQL verification passed eight concurrent identical publications with one child receipt, conflicting admission rejection, and foreign owner denial. Corrected timestamp serialization for the shared PostgreSQL driver. Full workflow dispatch still requires Conversation and platform workflow integration. No production migration applied.
+
+Ported the source BotActivityOutbox and activity read/mark services to Neon. Migration 0022 stores conversation activity. DO-local latest-value outbox persistence, conditional stale-delivery rejection, exact conversation/main-chat scope checks, and monotonic read versions are preserved. PostgreSQL and outbox runtime integration tests still need to run; no production migration was applied. Execution authority remains dependent on copy and lifecycle schema ports.
+
+Activity integration verification passed using actual local SQLite outbox statements and PostgreSQL storage: publication/drain, stale event rejection, account-isolated reads, foreign read-marker denial, monotonic read versions, and event-version clamping. The combined service verifier passed. This is not a deployed Durable Object runtime test, which remains required with the main Conversation integration.
+
+Ported bot/thread schedule generation storage and membership generation storage in migration 0023, preserving source archive/delete and membership insert/delete/change triggers. Adapted schedule generation reads to Neon and retained the original DO-local monotonic generation markers. PostgreSQL trigger verification remains pending. Execution authority still needs copy receipt storage before its full snapshot query can be ported without dropping checks.
+
+Lifecycle PostgreSQL checks passed: bot archive advances once, repeated archived updates do not advance, restore retains generation, thread archive advances and restore retains its marker, membership removal and rejoin advance twice. The complete local service verifier passed. These generations still need wiring into the ported Conversation runtime and execution authority.
+
+Added source conversation-copy metadata storage in migration 0024, including private idempotency, unique target identities, phase/status checks, manifests, and retry progress. Ported the full execution-authority snapshot to Neon, retaining exact conversation/account/workspace identity, lifecycle/membership epochs, copy-ready ownership checks, and inactive-chat denial. Copy service state transitions and retry linking remain to port. PostgreSQL execution-authority tests are still pending, no production migration applied.
+
+Execution authority PostgreSQL verification passed: exact identity and current membership epochs, inactive-chat denial and explicitly allowed inspection, pending-copy denial, ready-copy acceptance, and mismatched copy-owner denial. The combined local verifier passed.
+
+Ported the original connected-device service to Neon, preserving folder grants, private personal conversation restriction, credential revocation, atomic operation claiming, expiry, and no automatic replay. Device schema and integration checks are pending. No production changes applied.
+
+Connected-device PostgreSQL verification passed: private registration/listing, presence and folder grants, eight concurrent polls claiming exactly once, result delivery without replay, foreign revocation denial, and owner revocation cancelling pending operations. Full type checking passed and the combined local service verifier passed. Migration 0025 is local only; device routes and desktop client integration still need wiring.
+
+Ported source run admission and funded usage accounting to Neon in migration 0026. PostgreSQL transaction locks replace the source atomic D1 batch, serializing per-run receipts and same-day budget admission/settlement. Original policy limits, development exemption, server-resolved unlimited entitlement, scheduled allowance, reservation, and reconciliation rules are retained. Isolated PostgreSQL checks passed concurrent idempotency, request conflict, cross-day replay, turn/scheduled limits, unlimited entitlement, funded cap denial, and monotonic unknown-cost settlement. The combined verifier passed. Runtime wiring and production migration remain pending.
+
+Ported the full source ConversationThreads service and assistant thread tools. Migration 0027 retains request digests for delegated/manual replay. Replaced the earlier partial creation service with the original full implementation. PostgreSQL admission locks the parent and membership, checks the thread quota, and atomically stores conversation, source, and receipt. Type checking passed. Full service verification passed concurrent creation, frozen-source replay, title extraction, account-isolated context, main-parent restriction, versioned rename, archive reservation/release, empty-thread filtering, restore, and delegated receipt binding. Reservation/source RPCs are simulated in this database test; real Conversation runtime integration remains pending. No production migration applied.
+
+Ported the original conversation copy RPC contracts and resumable worker from conversation-copies.ts, separating worker and admission storage. Worker export, page digest/bounds checks, import verification, progress fences, retry backoff, and cleanup are retained. PostgreSQL publication locks the copy, source account/membership, and parent, then atomically publishes bot/conversation/main mapping and ready status. Type checking and isolated PostgreSQL integration passed, including concurrent publication, corrupt-page failure without publication, and private transient backoff. Fixed an ambiguous PostgreSQL sort column found by the test. RPCs are simulated here; actual DO export/import and copy admission/retry service ports remain required. No production changes applied.
+
+Ported original ConversationCopies admission, status, and source provenance service. PostgreSQL admission retains durable wake registration before publication, expiry deadline, exact source/parent checks, and idempotent command binding. Migration 0028 adds retry records, copy retry linking, uniqueness, and the original identity immutability triggers. Combined PostgreSQL integration passed concurrent copy receipt creation, private reads, conflicting requests, default fork parenting, foreign parent denial, and retry immutability. Real runtime source provenance, export/import, and retry preparation remain unverified. No production migration applied.
+
+Ported the original copyRetrySource verifier and retry row contract to Neon. It checks exact saved copy/retry account and source identity, boundary equality, request/evidence digest, and inherited review commitment without accepting retry input from the caller. Type checking passed. PostgreSQL tests passed valid immutable retrieval, absent retry, foreign account denial, boundary tampering, evidence tampering, and review commitment tampering. Full retry preparation still depends on message-reference and Conversation runtime ports; no production changes applied.
+
+Ported the original Kody account-object reference catalog to Neon, migration 0029. Source projection, bounds, account fingerprint checks, selected-object resolution/inspection, and revision-fenced publication are retained. Type checking and PostgreSQL tests passed publication/search/resolve/inspection, foreign account denial, stale competing refresh rejection, and account-change cache exclusion. Tests use synthetic Kody account responses, no live network call or production migration. Capability catalog and generic tool catalog remain prerequisites for the full message-reference port.
+
+Ported the full original generic MCP tool-reference catalog to Neon, migration 0030. Retained local configuration fingerprints, bounded catalog projection, exact reference resolution, fresh/stale display metadata, refresh checks, retention pruning, and guarded publication. PostgreSQL uses a serializable transaction for prune/publication. Restored the original ensureLegacy credential-list import dependency on McpAccounts rather than bypassing it. Combined database checks passed catalog refresh/search/resolve, private account denial, incomplete catalog rejection, and disabled connection exclusion. Legacy import, competing refresh, and full runtime integration still need direct verification. No production migration applied.
+
+Ported the full original Kody capability reference catalog to Neon, migration 0031. Original inventory collection, bounded staged publication, account fingerprint and policy checks, revision fencing, unchanged-inventory reuse, and secret projection are retained. Type checking and the combined PostgreSQL verifier passed, including capability search and exact resolution, unchanged publication reuse, foreign account denial, and exclusion of synthetic secrets from persisted items. Network responses were synthetic, and no production migration was applied. Full message-reference and Conversation runtime wiring remain required.
+
+Ported the full original message-reference service, including catalog composition, selected file/skill/plugin/connection resolution, private conversation discovery, related-thread tools, and transcript cursor validation. Seven source D1 query boundaries now use native PostgreSQL queries, retaining original access checks and millisecond metadata contracts. Source runtime access is an explicit referenceContext RPC interface. Type checking passed. Combined PostgreSQL verification passed metadata discovery and picker resolution, self exclusion, foreign account denial, archive filtering, deleted-source rejection, file metadata, and no transcript RPC during discovery. Actual transcript paging and remaining composite selections still require runtime integration verification. No production migration or deployment occurred.
+
+Ported the full original ConversationRetries preparation/status service. Reuses the immutable retry-source verifier already ported from the same source. PostgreSQL receipts retain JSON evidence/file plans, account scope, request identity, status fences, and destination lifecycle checks. Admission serializes per-account quota decisions and locks current source/membership rows. An explicit combined Conversation RPC interface retains capture and preparation snapshot behavior. Type checking and combined PostgreSQL verification passed eight concurrent identical requests producing one retry/copy, frozen replay, request conflict, foreign reads, readiness and draft publication, inert status reads, explicit submission/reset handling, archived-target denial, and failed-copy propagation. Runtime RPCs were simulated, file-transfer recovery and real Conversation integration remain unverified. No production changes applied.
+
+Ported original Kody background account synchronization to Neon, migration 0032. The original remote account-index code, probe cadence, account fingerprint, revision claim, shared inventory requests, and best-effort catalog synchronization are retained. Native PostgreSQL transactions replace D1 batches for guarded publication and atomic catalog invalidation. Type checking and combined PostgreSQL verification passed concurrent probe suppression, changed-index invalidation, unchanged-cache retention, superseded response rejection, foreign account exclusion, failed-probe recovery, and explicit action invalidation. Remote index responses were synthetic. Boot/background scheduling and real account synchronization remain to wire and verify with the Conversation/application runtime. No production migration applied.
+
+Ported source sidebar organization and workspace sync storage in migration 0033: merged bot metadata fields, private viewer pin/section/order/tags, sections/sort override, workspace source/published revision clock, and membership sync generations. PostgreSQL triggers preserve committed dirty revisions for bots, viewer state, sections, main mappings, and activity; membership removal/rejoin rotates generations. Section assignment guards retain workspace and viewer ownership checks. Combined PostgreSQL verification passed initialization, sidebar/metadata dirty revisions, foreign-section denial, removal clearing assignments, and membership generation rotation. Publisher/projection service, full BotWorkspace commands, and UI wiring remain to port. No production migration applied.
+
+Ported source workspace-sync membership and projection reads into workspace-sync-projection.ts. Native Drizzle reads replace the D1 batch with one read-only repeatable-read PostgreSQL transaction for the membership generation, source watermark, bots/viewer organization, private sections, and own main-conversation activity. The source millisecond timestamps and snake-case projection contract are preserved. Type checking and combined PostgreSQL checks passed exact projection revision, pin/section/tags/main mapping, private sections, foreign membership denial, revoked-read denial, and rejoin generation. The durable publisher and stream integration remain to port and verify. No production changes applied.
+
+Ported original WorkspaceSyncPublisher, internal stream transport, wake/recovery helpers, and WorkspaceSync Durable Object wrapper. The SQLite viewer outbox, immutable pending append, serialized publisher work, producer acknowledgement checks, membership recheck, bounded generation rotation, expired-stream rebasing, and alarms are retained. Shared clock reads/publication/recovery now use native PostgreSQL. The wrapper reuses TanStack host/database context, with its existing runtime declaration extended using the official Cloudflare DurableObject type. Type checking passed. Six publisher tests passed using actual local SQLite and mocked source/transport boundaries: restart after lost acknowledgement, concurrent snapshots, membership revocation/rejoin, generation bounds, expiry rebasing, and revocation during append. PostgreSQL publication/recovery queries and actual Cloudflare RPC/streams still require integration verification. No Cloudflare binding or production deployment applied.
+
+Ported original BotWorkspace sidebar and section read helpers into bot-workspace-reads.ts. Native PostgreSQL queries preserve full sidebar metadata, viewer state, explicit main mapping, private sections, source plain-array results, and bounded ID-keyset section discovery. Fixed a timestamp precision mismatch exposed by comparing the full helper output to the shared sync projection: both now retain original integer milliseconds. Type checking and combined PostgreSQL checks passed full projection equality, viewer-private sections, case-insensitive discovery, the 101-row lookahead bound, and stable paging independent of display order. Full BotWorkspace mutation commands, harness runtime, and UI remain to port. No production changes applied.
+
+Ported source BotWorkspace createSection, patchSection, and deleteSection into WorkspaceSections. PostgreSQL transactions and per-viewer order locks replace D1 batch guard records; membership is locked and section versions remain the edit gate. Position edits retain original clamping, dense ordering, and version increments. Sync wakeups require only the binding they use. Type checking and combined PostgreSQL tests passed eight concurrent creations with distinct positions, atomic reordering, sort metadata, exactly one winning concurrent edit, stale/foreign denial, section deletion clearing assignments, and sync wakeups. Bulk setSections and remaining BotWorkspace lifecycle/history/group mutations remain to port. No production changes applied.
+
+Ported original bulk setSections and its removeEmptySections behavior into WorkspaceSections. The captured bot versions and previous section IDs remain the write gate. PostgreSQL locks current membership, selected bots/viewer rows, and target sections, then performs one JSONB-backed upsert and scoped empty-section cleanup in the same transaction. Type checking and combined PostgreSQL checks passed batch assignment, occupied-section retention, empty-section removal, invalid batch rollback, duplicate/deleted selection rejection, competing stale assignment rejection, and foreign membership denial. Remaining BotWorkspace lifecycle/history/group mutations and runtime/UI integration are unfinished. No production changes applied.
+
+Ported original BotWorkspace.reserve into workspace-lifecycle-reservation.ts. Native PostgreSQL selects the same workspace-scoped main and thread conversations in stable order. Original identity binding, shared reservation token, draining retries, deadline, active execution denial, explicit release, and failure cleanup remain. Type checking and combined PostgreSQL verification passed workspace scope, complete selected conversation identities, one token, release, and cleanup when a later conversation rejects reservation. Conversation RPC responses were simulated. Full lifecycle callers and real Durable Object integration remain unfinished. No production changes applied.
+
+Ported original BotWorkspace.get as readWorkspaceBot, sharing the existing exact sidebar projection with a database-side ID predicate. Original workspace scope and missing-conversation error remain. Type checking passed, and PostgreSQL checks passed exact projection equality for each conversation, absent IDs, and cross-workspace exclusion. Remaining workspace mutations and runtime/UI integration are unfinished.
+
+Aligned the source personal-assistant classifier with the destination identity generated by openPersonalChatWorkspace: assistant: in personal:. Removed the copied Gum-specific kody identity assumption. Two focused tests passed, covering exact personal identity and exclusion of foreign accounts, organization conversations, ordinary conversations, and old Gum IDs. This fixes the shared classifier for forthcoming command/UI wiring; it does not prove all lifecycle command paths are wired.
+
+Ported source database parent guards in migration 0034. PostgreSQL triggers retain active same-workspace parent validation and recursive cycle rejection, with workspace-scoped transaction locks for hierarchy and parent availability writes. Combined PostgreSQL verification passed insertion/update rejection for unavailable parents, self and descendant cycles, valid moves, and concurrent opposing moves with exactly one committed relationship. The latter may abort a competing transaction through the database deadlock detector, callers still need source-facing error handling when full workspace commands are wired. No production migration applied.
+
+Started the source BotWorkspace command class, reusing the ported WorkspaceSections commands and exact read projection. Source creation, parent traversal, version/availability checks, and membership checks are retained. PostgreSQL transactions create the bot, conversation and explicit main mapping atomically, with membership locked at admission and source-facing parent race errors. Type checking and combined PostgreSQL verification passed six concurrent distinct creations, main mappings and source result metadata, nested creation, foreign/inactive parent rejection, membership/input denial, and sync wakeups. Patch/history/group/lifecycle commands remain unfinished. No production changes applied.
+
+Ported source BotWorkspace.patch. PostgreSQL locks membership and current bot state, checks the source expected version/deletion gates, applies metadata atomically, retains parent and personal assistant guards, and preserves archive reservation identity-set/deadline fencing with unconditional release. Original D1 mutation leases become native transaction checks rather than compatibility tables. Combined PostgreSQL checks passed competing edits with one winner, stale/deleted/foreign denial, assistant archive prevention, parent checks, archive/unarchive, and a late conversation appearing after reservation causing rollback and release. Durable Object reservation RPCs were simulated; real runtime wiring remains unfinished. No production changes applied.
+
+Ported source BotWorkspace.organize and reorderBots. Viewer fields use supplied-field-only upserts, preserving concurrent pin/tag updates. Native PostgreSQL transactions and shared viewer-order locks retain membership/version/deletion gates, private section validation, source peer-group selection, dense position assignment with clamped placement, and empty previous-section removal. Type checking and combined PostgreSQL verification passed private viewer projections, deduplicated tags, concurrent field merging, invalid-section rollback, three-peer dense ordering at start/end, and empty-section cleanup. Full history/group/lifecycle commands, runtime and UI remain unfinished. No production changes applied.
+
+Ported source subtree deletion and restoration into BotWorkspace. Native PostgreSQL transactions replace snapshot mutation leases, retaining complete subtree/version comparison, reservation conversation-set fencing, expiry rollback, unconditional release, active-ancestor reparenting, and deletion-batch-specific restoration. Hierarchy changes serialize at workspace scope, row locks cover only observed subtree members. Source Trash/version behavior is retained and personal assistant deletion is rejected explicitly. Type checking passed before the final query-only lock refinement, combined PostgreSQL checks passed both before and after refinement: subtree delete/restore, older deletion exclusion, reparent deletion, stale/assistant denial, and a new descendant arriving during reservation causing rollback. Reservation RPCs were simulated. History/group commands and actual runtime/UI/deployment remain unfinished. No production changes applied.
+
+Ported source move/moveGroup using the unchanged botDragLayout and moveBotGroup algorithms. PostgreSQL commit locks viewer order, hierarchy, membership and layout rows, rechecks the complete captured layout inside the same transaction, validates destination section/parent, then applies root hierarchy changes and projected viewer metadata atomically. Sidebar reads now accept the existing transaction to avoid a second-pool read during commit. Type checking and combined PostgreSQL verification passed complete projected hierarchy/viewer/position/version equality, parent-child selection deduplication, carried subtree metadata, stale layout denial, one winning competing move, and cycle rejection. Source applyHistory remains to port. Conversation runtime, API/UI integration, bindings and deployment remain unfinished. No production changes applied.
+
+Ported source applyHistory, retaining original input/identity/hierarchy validation and guarded before-state comparisons. PostgreSQL transactions replace mutation leases, lock membership/layout/sections, verify section ownership and assignment removal, recreate sections before assignments, detach changed parents before applying the final hierarchy, preserve archive timestamps, advance versions, and release archive reservations unconditionally. Type checking and combined PostgreSQL checks passed undo/redo, section recreation/removal, stale history conflicts, one winning concurrent change, archive/unarchive and whole-change rollback when one affected row conflicts. All source public BotWorkspace command methods now have destination implementations, with section commands inherited from the ported WorkspaceSections. This is not full consolidation completion: command API/runtime wiring, actual Durable Object integration, chat UI, bindings, auth end-to-end and production cutover remain unfinished. No production changes applied.
+
+Ported the full original assistant-conversation-tools service and TanStack AI definitions. Reuses the shared ConversationIdentity resolver and ported BotWorkspace, replacing D1 main-mapping lookup and sidebar reads with native PostgreSQL. Tool descriptions, expected version handling, explicit setting writes, changed-after-write outcomes, main-only restriction and initiating/target access rechecks remain. Type checking and combined PostgreSQL verification passed inspect metadata, rename/pin dispatch, stale write denial, fresh thread target exclusion, foreign target exclusion, and deleted initiating conversation denial. Section tool dispatch and real model/runtime registration still need end-to-end checks. No production changes applied.
+
+Ported original recipes storage as chat_recipes in migration 0035 and extracted SavedActions from source API create/delete and workspace/runtime reads. Fields and integer millisecond creation timestamps retain the source contract. Shared authenticated membership protects reads and mutations; creation locks current policy and membership, parses the original recipe schema and requires allowKody, while deletion remains possible when creation is disabled. Type checking and combined PostgreSQL tests passed 35 concurrent actions, private listing/creation/deletion scope, the 30-action runtime bound, input validation and policy-gated creation. Conversation runtime remains to adapt and register this service. No production migration applied.
+
+Extracted original Conversation lifecycle, retry-readiness and run-context database boundaries into conversation-database.ts. Native PostgreSQL reads preserve bot/thread archive/deletion metadata, exact ready retry/copy pair and account/target scope, current member policy, source bot metadata and bounded action reads. Run context uses one read-only repeatable-read snapshot. Invalid UUID readiness inputs return false rather than a PostgreSQL input error, retaining the source missing-identity outcome without casting indexed identity columns. Type checking passed before this final UUID-input refinement. Combined PostgreSQL checks passed context privacy and bot scope, integer source timestamps, action limit, lifecycle missing/active states, actual ready/ready and failed/failed retry pairs and foreign/malformed identity denial. These are internal database boundaries, not authorization replacements. Full Conversation class adaptation and runtime registration remain unfinished. No production changes applied.
+
+Ported Conversation.activateCopyImport activity/read publication checks and discardCopyImport published-conversation lookup into native PostgreSQL boundaries. The source event-version and exact message-count gates run before markConversationRead, followed by persisted watermark confirmation. As in the source, copy/identity authorization precedes these internal checks and remains the caller responsibility. Type checking and combined PostgreSQL verification passed missing/stale projection, mismatched message count, scoped read update, successful watermark confirmation, and published/missing conversation detection. Full copy activation state transitions and real Durable Object integration remain to wire and verify. No production changes applied.
+
+Registered source StreamObject and ported WorkspaceSync as named exports from the existing TanStack Worker entry, retaining its Sentry/host/runtime/request implementation. StreamObject is the same @durable-streams/server-cloudflare package class used by Gum. Added STREAMS and WORKSPACE_SYNC bindings and a fresh tanchat-v1 SQLite Durable Object migration to TanStack Wrangler configuration. Wrangler configuration/runtime type generation and project type checking passed. Types were generated to a temporary file, not applied over existing production environment declarations. No deployment or remote migration occurred. Conversation/Workflow classes and bindings, live RPC/stream behavior, API/UI integration, auth and /builder cutover remain unfinished.
+
+Ported full source Workflow driver as TanChatWorkflow with an explicit Conversation advanceWorkflowRun RPC contract and official Cloudflare Workflow types. Original params schema, 900-pass bound, durable checkpoint names, retry/backoff/timeout, receipt-only persistence, deadline-relative sleeps, terminal status handling and needs_attention exhaustion result are retained. Ported both original driver tests, adapting paths/class name only; both passed, covering stable step reconciliation and no model-loop fallback on RPC failure. Project type checking passed. Workflows binding/export and actual Conversation integration remain to wire together; no remote workflow deployment occurred.
+
+Ported the remaining source Conversation workflow-child publication, router username hint and final usage receipt-start reads into conversation-database.ts. Exact child conversation/bot/account matching and integer receipt timestamps are retained. Type checking and combined PostgreSQL verification passed true/false child identity matches and existing receipt timestamp equality. Username projection was compared for available fixture rows; real account hints remain to verify with runtime integration. These internal reads require the original caller authorization flow. Full Conversation class adaptation and live registration remain unfinished. No production changes applied.
+
+Started the full original Conversation class port, copying the complete source file rather than reconstructing its loop. Updated moved identity/credentials/copy imports, exposed the shared inferred ConversationIdentity type, defined explicit runtime binding contracts, and switched already-ported activity, identity, execution authority, policy preference, schedule lifecycle, memory, workflow definition and usage calls away from D1 signatures. The first project type check reports remaining unconverted D1 accesses, service option differences and platform/RPC type mismatches. The class is not mounted/exported from the Worker and is not ready to deploy. Compilation is currently incomplete while the native runtime boundary adaptation proceeds. No production changes applied.
+
+The complete source Conversation class now passes the destination project TypeScript check after replacing its remaining D1 reads with the native PostgreSQL services. Delegation and schedule context reads skip saved actions, preserving their original scope. This proves compilation only, the Conversation class still needs runtime context wiring, bindings and live integration verification.
+
+Conversation runtime wiring now scopes constructor recovery and all 78 asynchronous public entry points to the shared host environment, execution context and database context. Nested database scopes reuse the existing context so internal calls share the request connection. The synchronous lifecycleState method remains synchronous and reads local state only. TypeScript passes. Live Durable Object execution and background lifetime verification remain outstanding, and Conversation is not yet registered for production.
+
+The Worker entry now exports Conversation and TanChatWorkflow. Wrangler declares CONVERSATIONS, the separate tanchat-v2 SQLite class migration, and WORKFLOW_RUNS. Generated binding types resolve both classes, project TypeScript passes, and the existing workflow-driver/workspace-sync tests pass (8 tests). No deployment or production migration was run. These checks do not prove full Conversation execution, remaining environment bindings and live integration still need verification.
+
+Conversation FILES now aliases the existing tanstack-notebook-projects R2 bucket, preserving the original saved-files/{UUID} key namespace, and AI is bound to Workers AI. Binding generation and TypeScript pass. The actual Worker build was started, its result remains pending. Gateway configuration and encryption/router secrets have not been provisioned by this change.
+
+The original history/stream handler extraction passes TypeScript. Two HTTP contract tests verify that live responses retain their exact Response identity and stream headers without buffering, and unsupported methods do not invoke the object. These handlers remain unmounted pending the authenticated HTTP dispatcher. The previously pending Worker build completed successfully.
+
+Authenticated GET history/stream routes are registered at /api/chat/conversations/{id}/{operation}. The original handlers use shared TanStack session/capability checks, then native PostgreSQL identity authorization, then bind the resolved identity before reading the object. Seven mocked HTTP boundary/stream contract tests pass, including signed-out, missing capability, duplicate workspace and failed authorization denial before storage access. The actual Worker build passes and includes the generated route. Live session/DO checks remain pending.
+
+The original message submission schema, begin invocation and response status mapping are extracted into conversation-send-api.ts. Identity, bot, policy, recipes, fixture mode and app origin remain supplied exclusively by the server-side caller, not accepted from the request schema. The send handler is not mounted yet, lifecycle and authenticated context admission remain to be connected.
+
+The original send handler is mounted as POST /api/chat/conversations/{id}/send. Shared session/capability and same-origin checks precede PostgreSQL identity/lifecycle authorization; bot, policy, saved actions, user, origin and non-fixture mode are derived server-side. The original Conversation.begin remains responsible for admission revalidation. TypeScript passes and the HTTP boundary suite passes 8 tests, including cross-origin denial, archived denial and rejection of request-supplied user/policy/fixture context. Live model execution and UI remain pending.
+
+Original stop, queue, reset, dismiss-task, continue-task and approval branches are ported and mounted behind shared authorization. Stop remains allowed for archived conversations, queued resume/run-next remain denied for archived/deleted conversations, and approval/continuation contexts are loaded server-side only when needed. Archived thread state is included in the native lifecycle gate. The existing eight HTTP boundary tests pass after preserving early archived send denial. Live control behavior remains unverified.
+
+The nine original browser client modules, WorkspaceApi, ExecutionSessionEvidence and loading UI dependencies are copied byte for byte with source hashes in tanchat-client-port.json. Source Durable Streams client and Lucide dependencies are installed. Original browser tests with import-only relocation pass 237 checks across nine suites, and TypeScript passes. This proves the copied browser behavior in isolation, original API paths still need adaptation and the full application UI is not mounted.
+
+The remaining 216 original component/style files are now copied byte for byte, bringing the full Gum component tree into src/chat/components. Provenance remains in tanchat-client-port.json. This is an in-progress UI port: the destination router does not yet declare the original workspace paths, and the source UI dependency ranges are being installed. TypeScript currently fails on those integration boundaries. The UI has not been mounted or claimed ready.
+
+The original workspace, conversation and home-section routes are ported under /chat/w. Copied component links and the original file/conversation navigation helpers use that namespace, with changed hashes recorded. The full application Worker build succeeds with the original UI route tree included. Auth/bootstrap, provider composition, scoped styling and browser behavior remain unfinished, and the destination type check after route generation is pending.
+
+The full copied UI passes TypeScript after binding HomeDashboard search to its exact workspace route and aligning React DB 0.4.1 with the original collection API. /chat now owns the original tooltip/execution provider composition above workspace navigation, reusing the existing site Query provider. The provider shell Worker build passes. Bootstrap, scoped global styling and live browser verification remain incomplete.
+
+Bootstrap workspace data now composes the original bots, sections, activity, recipes, policy and accessible-workspace reads through native PostgreSQL services after membership authorization. The source onboarding table/service is still missing and must be ported, no synthetic onboarding state is supplied. Credentials, spending and full HTTP bootstrap composition remain outstanding.
+
+Onboarding now has native PostgreSQL tables and migration 0036, preserving source status/use-case/revision/completion constraints and command receipts. Personal workspace creation initializes pending onboarding atomically. The source service access checks, exact command digest replay, version conflict and name/use-case/save/skip semantics are ported with PostgreSQL row-locked transactions replacing D1 batches. Actual PostgreSQL concurrency and rollback tests remain required. No production migration was run, and bootstrap remains unmounted.
+
+The complete native PostgreSQL workspace verifier passes with onboarding migration 0036. New checks cover eight identical command submissions returning the exact same receipt, changed payload rejection, competing revisions with one winner, skip preserving name/use-case, and an injected workspace update failure rolling back both onboarding state and command receipt. The local PostgreSQL cluster was stopped afterward. This does not verify real simultaneous distributed connections or the HTTP onboarding UI.
+
+Original account onboarding GET/POST behavior is mounted at /api/chat/account/onboarding through shared session/capability checks, same-origin mutation protection and original bounded JSON parsing. Four HTTP tests pass for session-derived account selection, signed-out denial, cross-origin denial and service dispatch. Worker build succeeds. The copied browser request base still needs /api/chat alignment, bootstrap remains incomplete.
+
+The original WorkspaceApi now resolves all account/workspace requests under /api/chat, supplying workspaceId scope consistently to fetch and stream URLs while preserving existing query parameters. Eighteen URL/collection tests pass. Not all original HTTP operations are mounted yet, so this does not make the full app functional. Onboarding route TypeScript passes.
+
+Bootstrap response composition now uses native onboarding, workspace inventory, encrypted connections, Kody local sign-in state, MCP accounts, daily usage and funded-spend services, mapped to shared TanStack AuthUser. Original workspaceActivity serialization is copied explicitly to preserve the browser field contract. The bootstrap service remains unmounted pending environment and HTTP integration and actual database verification.
+
+The complete PostgreSQL verifier passes native bootstrap identity, personal assistant, pending onboarding, included connection defaults, activity serialization and foreign-workspace denial on an isolated new account. The authenticated bootstrap GET endpoint is mounted at /api/chat/bootstrap and source non-secret model/Kody settings are declared in Wrangler. Encryption/router/Gateway secrets remain unprovisioned, bootstrap reports configuration failure rather than fabricating credentials. Local PostgreSQL was stopped after verification. Worker endpoint build is pending.
+
+### Chat entry and main conversation HTTP routes
+
+The `/chat/` entry now uses the existing TanStack current-user lookup and login return path, then opens the native personal workspace and assistant. The chat parent suppresses the site navbar and footer. The actual Worker build and TypeScript check passed for this entry change. The bootstrap endpoint Worker build also passed.
+
+The copied Gum client requests main-chat history and sends through `bots/:id`, while threads use `conversations/:id`. Both HTTP routes now use the same native conversation service. Bot routes resolve the signed-in user's main conversation through PostgreSQL membership and ownership checks before accessing a Durable Object. No caller-supplied conversation identity is trusted. Ten conversation HTTP boundary tests pass, including bot reads and sends resolving to the authorized main conversation.
+
+The bot route is new TanStack boundary wiring around the previously ported original Gum read/send/control handlers. It does not reconstruct their behavior. Live browser execution, the remaining HTTP operations, and a build including the new bot route remain unverified.
+
+### Committed send receipts
+
+Ported the `send-receipt` branch from Gum `src/server/api.ts` into the shared conversation HTTP boundary for both bot and thread routes. It calls the original ported `Conversation.sendReceipt` method after account ownership resolution and identity binding. It validates the original message identifier limits and uses the existing TanStack JSON response utility. This restores the server endpoint needed by the copied `usePendingSend` reconciliation logic. Twelve HTTP boundary tests pass, including committed receipt passthrough, binding before receipt lookup, and rejecting absent message identifiers. Live submission recovery remains unverified.
+
+### Composer draft HTTP wiring
+
+Mounted the existing native PostgreSQL composer draft service under `/api/chat/account/composer-drafts/:accountId/:scope`. The HTTP boundary preserves Gum's original account mismatch rejection and bounded JSON handling, with TanStack session authentication and chat access checks. The copied `useCloudDraft` changes only its URL namespace, retaining its original sync, conflict and revision logic. Five HTTP tests pass for account isolation, signed-out reads, cross-origin writes, revision forwarding and malformed JSON rejection. The previously verified native PostgreSQL service retains its optimistic revision checks and empty-value tombstones. Browser draft syncing and generated route build remain unverified.
+
+### Account preferences HTTP wiring
+
+Mounted Gum's account preference read/write operations at `/api/chat/account/preferences`, using the previously ported native PostgreSQL preference service and TanStack session identity. The copied preference client already uses the shared chat API namespace, so no client logic changes were needed. Five HTTP tests pass for session identity, signed-out reads, same-origin writes, bounded JSON forwarding and conflict status preservation. The Worker build containing bot routes and composer drafts finished successfully. Preferences were added afterward and still need route generation and build verification. Full browser settings behavior remains unverified.
+
+### Workspace index read wiring
+
+Ported Gum `src/server/workspace-index.ts` directly, changing only the database parameter and the import of the already ported native read functions. Mounted `/api/chat/workspace-index` using shared session identity and an explicit workspace membership check before reading bots and private sections. This restores the original sidebar index response shape. The preferences Worker build passed. The new workspace index route and live sidebar refresh remain unverified.
+
+Workspace index HTTP verification: five boundary tests pass, proving session identity is used, membership is checked before index reads, signed-out and unauthorized accounts do not read data, and duplicate workspace selectors are rejected. These are mocked HTTP boundary checks, not a live sidebar or database verification. Source and destination hashes for the original index composition are now recorded in the server port manifest.
+
+### Workspace sync HTTP port
+
+Ported Gum's workspace sync snapshot and stream branches from `src/server/api.ts`. Both now use TanStack auth and the native PostgreSQL membership generation. Original generation checks before and after snapshots remain. Long-poll streams recheck the session and membership before returning, canceling the response body if access changed. Stream responses pass through without buffering or reconstruction. Four HTTP tests passed for stream passthrough, membership-change cancellation, snapshot generation rejection and signed-out denial. The workspace index Worker build passed. The sync routes still need generated route build and real Durable Object/browser verification.
+
+### Committed sidebar mutation responses
+
+Ported the original `indexResponse` helper from Gum's API before wiring sidebar mutation endpoints. A committed mutation still returns success with `syncPending` when snapshot delivery fails, preventing the client from retrying an already committed command. Access loss returns 403, and deployments without the publisher use the original index read response. Three focused response tests passed. This helper is not yet attached to mutation routes. Sync HTTP and response helper provenance are recorded in the server manifest. The sync route Worker build is still running.
+
+### Sidebar section HTTP commands
+
+Mounted the original create, patch and delete section dispatch against the previously ported `WorkspaceSections` service. Shared session and workspace membership checks precede changes, request bodies remain bounded, and original version validation stays in the native service. Committed commands use the original index/sync response semantics. Three HTTP boundary tests pass for authorization ordering, revision forwarding and cross-origin rejection. The workspace sync Worker build passed. The section route build is running, and actual browser mutations remain unverified.
+
+### Bot mutation HTTP wiring in progress
+
+Connected original Gum API dispatch for bot creation, patch, organization, move, delete and restore to the previously ported native `BotWorkspace` service. The service retains original optimistic versions, personal assistant protection, subtree behavior and lifecycle reservations. Creation keeps its original direct JSON response, and other mutations use the original committed index/sync response helper. This boundary wiring is not yet verified by tests, generated route build or live browser use. The section Worker build passed.
+
+Bot mutation HTTP verification: seven tests passed covering direct create response, workspace authorization before creation, patch revision forwarding, cross-origin denial, move/delete/restore dispatch and rejecting POST organization changes. The preceding full sidebar TypeScript check passed. It started before bot mutation wiring, so it does not prove the new bot routes type-check. The bot mutation build remains running. Source sections and hashes for section and bot mutation boundaries are now recorded.
+
+### Bulk sidebar commands and group moves
+
+Extracted the original Gum bulk command loop directly from `src/server/api.ts`. It preserves individual success/failure results and archive revision forwarding. Mounted bulk and group move POST routes using the existing authenticated bot mutation boundary and native `BotWorkspace.moveGroup`. Two focused bulk service tests pass for partial archive failure and pin dispatch. The original bulk loop remains sequential, this port does not claim a speed improvement. The preceding bot mutation Worker build passed. New bulk routes still require build/type and live browser verification.
+
+### Sidebar history HTTP wiring
+
+Connected Gum's original workspace history POST dispatch to the native `BotWorkspace.applyHistory` service and original committed sync/index response. The existing PostgreSQL service retains before/after validation and atomic history application. Nine bot mutation boundary tests now pass, including history and group move dispatch without accidental bot creation. Actual UI undo/redo and the latest route build/type checks remain unverified. The prior bulk route build is still running.
+
+### Combined sidebar verification and navigation correction
+
+All 48 tests across nine new boundary/service suites pass together. The full sidebar Worker build and TypeScript check passed. Original navigation tests found a leftover `/w/` regex in sign-in destination validation, which rejected the intentionally moved `/chat/w/` links. Updated that prefix and original test URLs, preserving bounds and open redirect rejection. All 24 navigation/message navigation tests now pass. The regex correction was made after the build/type check and still needs subsequent compilation.
+
+### Conversation read acknowledgements
+
+Ported Gum's `read` POST branch to both main bot and thread conversation routes. It validates the original safe integer version body, resolves account/workspace ownership, calls native `markConversationRead`, and returns the original persisted read-version acknowledgement. The source acknowledgement SELECT now uses PostgreSQL table names and explicit numeric decoding. Like Gum, this operation does not open a conversation Durable Object. Thirteen conversation HTTP tests pass, including account-scoped read marking. The new native acknowledgement query still needs actual PostgreSQL verification, and live unread behavior remains unverified.
+
+### Read acknowledgement PostgreSQL verification
+
+The full native PostgreSQL verifier passed on a fresh isolated database after adding acknowledgement query checks. Authorized reads return the persisted bounded version; foreign account and foreign workspace reads return zero. Existing monotonic read markers, activity outbox delivery and stale event checks also passed alongside all existing native workspace verification. The isolated database server was stopped afterward. These prove the PostgreSQL query behavior, not live browser unread state.
+
+### Transcript navigation and archived history HTTP port
+
+Ported Gum's navigation and archive read branches through the already authorized main-chat/thread endpoints. Navigation retains cursor validation and the original required epoch for earlier pages, allowing only the additional workspace selector required by the shared API. Archive reads preserve exact message lookup and safe integer paging. Sixteen conversation HTTP tests pass, including navigation forwarding with epoch, duplicate cursor rejection and archived message passthrough. Real transcript storage/browser paging and the new handler compilation remain unverified.
+
+### Broad ported core verification and model catalog wiring
+
+The complete ported core suite passed: 166 suites and 1,866 tests. This is broad source-contract coverage, not proof of full live parity. Mounted the original model-options operation against the already ported model catalog and model environment services. The endpoint uses shared account identity, workspace policy and live configuration, with no fixture choices. Its new HTTP wiring and generated route build remain unverified.
+
+Model catalog HTTP verification: four tests passed for server-owned identity and policy, disabling caller-selected fixture behavior, denying provider configuration reads after access rejection, and preserving configuration errors. The preceding full type check passed for transcript/read-marker wiring. Model routes were added afterward, so their compilation is still pending.
+
+### Saved action HTTP wiring
+
+Mounted original recipe create/delete operations against the native `SavedActions` service. Shared session and workspace membership checks precede dispatch, writes enforce same-origin and bounded JSON handling, and original service policy validation remains. Three HTTP tests pass for create forwarding, delete identity and cross-origin denial. New saved action route generation and live settings use remain unverified.
+
+### Provider connection settings port
+
+Extracted Gum's original provider connection update callback, preserving existing provider keys when no new key is supplied, normalizing included models to server configuration and removing included API keys. Mounted the connection POST endpoint with shared session/workspace policy checks and native encrypted credential storage. Three service tests passed for key preservation, included normalization and policy rejection before storage. Endpoint/live settings behavior remains unverified. The provider/saved action route build is running.
+
+Provider HTTP verification: five boundary tests passed for session-owned credential target, authorized workspace policy, signed-out denial, no configuration access after membership rejection, configuration error preservation and cross-origin rejection. The actual Worker build containing provider and saved action routes passed, and generated routes contain those endpoints. The current full type check is still running. Live credentials and model execution remain unverified.
+
+### Thread HTTP wiring
+
+Ported the original thread list, detail, create, rename, archive and delete dispatch through existing conversation routes, using the native `ConversationThreads` service. Shared account/workspace authorization precedes service access, and mutations retain same-origin/bounded request handling. DELETE preserves the source behavior of reading the current version then archiving with lifecycle reservation enabled. Three boundary tests passed for listing, versioned delete dispatch and cross-origin denial. Create/rename runtime behavior and the latest compilation remain unverified.
+
+Thread HTTP coverage now includes six passing tests for original idempotency/source message forwarding, rename version forwarding, malformed command rejection, listing, delete/archive semantics and cross-origin checks. Source provenance is recorded. These mocked dispatch checks do not prove transcript context capture or live thread creation. Actual PostgreSQL thread service contracts were verified in the broader native verifier, while the current Worker build and full type check are still running.
+
+### Saved-file HTTP routes
+
+Connected the existing ported `fileApi` to main bot, thread conversation and draft file routes, including metadata and content paths. Shared account/workspace checks precede access; main and thread routes resolve authorized conversation ownership before touching R2. The original file API retains content streaming, download headers, preview restrictions, bounded uploads and native storage behavior. This is boundary wiring around existing source code. The thread full TypeScript check passed. New file route build is running; file HTTP boundary checks, actual R2 streaming and browser upload/download remain unverified.
+
+File route Worker build passed. Four HTTP boundary tests passed for exact original Response passthrough, ownership rejection before R2 lookup, session-owned draft scope and cross-origin upload denial. These mock the original file API and do not prove live R2 uploads or downloads. The full type check is still running. File boundary source provenance is recorded.
+
+### First-message draft execution gap
+
+Source inspection found that the native draft port currently implements reservation and receipts, while original `BotDrafts.start` execution orchestration is not yet wired. Added the native started-receipt write needed by that source flow, retaining session-owned workspace membership checks in a transaction. The runtime port still needs original model/attachment/reference validation, authorized conversation admission and post-admission receipt persistence. This method is not yet verified. No draft start route has been mounted prematurely.
+
+### First-message runtime source port
+
+Added `startBotDraft`, copying the original model/attachment/reference preparation block directly from Gum `BotDrafts.start`. Native draft reservation retains the frozen model choice and file promotion. The original conversation begin payload uses `draft:` idempotency and only persists started state after admission succeeds. Authorized identity is explicitly bound before begin. Fresh-only drafts require the reserved model; legacy model-less data recovery is not included because no data migration is requested. This orchestration is not yet mounted or runtime-tested. Its full type check is running.
+
+Draft started-receipt verification passed in the full native PostgreSQL verifier on a fresh database. Reservation begins unstarted, markStarted persists started state, replays remain idempotent, and a foreign account cannot mark the receipt. A TypeScript check caught an intersected namespace overload selecting the narrower reference stub; the draft environment now uses the full Conversation namespace explicitly while preserving the remaining reference environment. The corrected type check is running. Actual admission and draft HTTP mounting remain incomplete. The isolated database server was stopped.
+
+### First-message draft endpoint mounted
+
+Mounted original draft receipt GET and start POST operations. Reads use native account/workspace draft persistence without requiring provider credentials. Starts derive account, policy, saved actions, live mode and app origin server-side, then call the source-based draft orchestration. Three HTTP tests pass for server-derived context, credential-free receipts and cross-origin denial. Corrected draft runtime types passed before endpoint mounting. The endpoint Worker build is running; live first-message execution remains unverified.
+
+### Shared sign-in UI
+
+The draft endpoint Worker build and full TypeScript check passed. Removed the imported Gum magic-link sign-in flow from the chat App and reused TanStack's existing SignInForm for expired or missing sessions. Social login now uses the existing shared auth client and returns to /chat. Legacy Gum hash-token handling is removed, no separate authentication implementation is introduced. The new UI change still needs compilation and browser verification.
+
+### Original base styles mounted
+
+Shared sign-in TypeScript verification passed. Ported original motion, mobile and base CSS in original import order, retaining font loading and every source rule. A chat-only scope is active while the ChatShell marker exists, and the chat route provides the stylesheet link. The marker uses display: contents to preserve existing app layout. This needs actual Worker CSS compilation and rendered browser verification, including navigation back to non-chat pages. Appearance preference synchronization and mobile service-worker infrastructure remain separate unfinished work.
+
+### Execution session dispatch port
+
+The scoped base-style Worker build passed. Copied the original execution session command, snapshot, history and event cursor dispatch block from Gum api.ts into the shared-auth route boundary. Existing Conversation execution RPCs remain the implementation. Workspace query scoping is removed before original execution cursor validation, and account ownership is resolved server-side. Original local opt-in execution restriction remains. Snapshot blob routes and live browser host execution are still unfinished. Compilation is running.
+
+### Execution snapshot source port
+
+Copied Gum's original execution-project-snapshots service, retaining bounded transfers, R2 checksum verification, repeat authorization and idempotent reservations. Added GET/PUT snapshot routes and adapted the original execution client to /api/chat with immutable workspace query scoping. The first execution dispatch type check found numeric status arguments being passed to TanStack's ResponseInit helper, corrected to jsonError. Worker compilation is running, live snapshot transfers remain unverified.
+
+Execution snapshot Worker build passed. All 89 original transport and snapshot-format tests pass after adapting URL assertions to the chat namespace and workspace query. Five new shared-auth boundary tests pass for server-owned identity, cross-origin denial, preserved opt-in restriction, unchanged snapshot Response forwarding and invalid cursor rejection. These tests do not prove live R2/DO transfers or browser host execution. Full TypeScript verification is still running.
+
+Snapshot full type verification found source global R2 types broader than the shared storage interface. Verification now requires only size/checksums, the fields it actually inspects, and conditional creation uses the existing typed etagDoesNotMatch wildcard instead of a Headers option. No casts or compatibility shim added. The corrected full type check is running.
+
+Corrected execution snapshot full TypeScript verification passed. Ported original task-usage, runs and action-evidence read dispatch blocks from Gum api.ts into the authorized conversation endpoint. Retains original pagination limits, usage selection and RPC behavior. Type verification is running; live run-history and usage UI behavior remain unverified. Appearance isolation audit found multiple body portals outside the existing PortalContainer context, so a coordinated portal/theme change remains outstanding.
+
+Run/usage/evidence full types passed and 22 conversation boundary tests passed. Added the original copy-boundary read dispatch, replacing only its D1 lifecycle lookup with the existing native PostgreSQL lifecycle reader after ownership authorization. Original message/side validation and RPC status semantics remain. Copy boundary tests and latest type verification are running.
+
+Copy-boundary full types and all 24 conversation boundary tests passed. Added original retry-source capture with native lifecycle and membership-owned policy readers, server-derived live mode, and original bounded message selection. RPC JSON is parsed through a typed result envelope and the existing parseRetrySource validator instead of the source's result cast. Latest boundary tests and full types are running. Actual retry branch creation and live recovery remain separate unfinished verification.
+
+Retry-source full TypeScript verification passed. Added original delegation history/current-task read dispatch and schedule snapshot read using the existing Conversation RPCs and ownership boundary. Controls are not mounted yet because source workflow-child parent control restrictions need native persistence wiring first. Latest conversation boundary tests and types are running.
+
+Delegation/schedule read full types passed. Added the source workflow-child owner lookup using PostgreSQL and preserved the original parent-only restriction for all mutation operations except read acknowledgement. Connected original delegated-task cancellation and schedule command dispatch after that guard. Latest tests and full types are running; the ownership query and live controls still need real database/runtime verification.
+
+Workflow owner lookup passed in the full fresh PostgreSQL verifier: a published child resolves its owning conversation, a main conversation and unknown ID resolve null, and existing admission replay/foreign-owner checks remain passing. The controls type check found the original combined-method GET schedule branch unreachable in the POST-only handler, removed that branch because GET is already mounted separately. Corrected full types are running.
+
+Corrected delegation/schedule control types passed. Ported original workflowApi definition list/read/command behavior and mounted shared-auth collection and revision reads against the native Workflows service. Original query validation, immutable revision commands and private no-store responses retained. Worker build is running. Workflow run/start/cancel HTTP wiring remains incomplete.
+
+Workflow definition Worker build passed. Copied original workflowRunApi start, withdraw, inspect, list, answer/files and cancel dispatch, preserving strict inputs, 202 start status and pagination. Mounted behind shared session/account/workspace identity and typed Conversation namespace. Worker build is running; actual workflow admission/execution and run HTTP boundary checks remain unverified.
+
+Workflow run Worker build passed and four HTTP boundary tests passed. History audit found workflow child metadata omitted from the ported history boundary even though the source read API supports it. Native reader now returns original ownerConversationId/runId/stepId projection and history forwards it to the original response assembler. Updated the PostgreSQL verifier for the complete projection and added a history boundary test. Latest boundary tests and full types are running; the extended projection has not yet been rerun against PostgreSQL.
+
+All 42 current conversation/workflow HTTP boundary tests passed, including workflow-child metadata preservation. These mock coordinator/storage reads and do not replace live runtime proof. Full TypeScript check remains running.
+
+Mounted original bot/conversation copy creation and operation status contracts through native ConversationCopies and shared-auth workspace membership/identity checks. Retains source copying=202, ready=201 and other=200 creation statuses, immutable operation lookup and strict service-owned idempotency. Copy HTTP runtime behavior remains unverified. Build is running.
+
+Copy-route Worker build passed and three boundary tests passed. Mounted original retry create, prepare and get contracts through native ConversationRetries, shared session/workspace membership and server-derived policy/live mode. Preserves preparing=202 and other=200 statuses, explicit preparation and side-effect-free get behavior. Retry namespace, file and MCP configuration are server-derived. Worker build is running; live retry preparation and latest full types remain unverified.
+
+Retry Worker build passed and four retry boundary tests passed for passive status polling, explicit prepare command, authorized creation and cross-origin rejection. Added original copy-source read contract using native getCopySource for the copied origin/return UI, no creation during reads. Latest copy-source tests are running. The full copy/retry type check is still running.
+
+Copy/retry full TypeScript verification passed. Mounted original workspace activity GET contract using the already-ported bootstrap activity serializer and native readBotActivity, with shared session and workspace membership checks. No new activity persistence or inferred states added. Worker build is running; live sidebar refresh remains unverified.
+
+Workspace activity Worker build passed and five boundary tests passed. Ported original owner-only policy mutation to PostgreSQL, preserving policySchema and repeating owner identity in the update predicate. Shared session, membership and same-origin checks precede mutation. New policy route build and native verification remain outstanding.
+
+Policy Worker build passed. Three policy HTTP boundary tests passed. Full fresh PostgreSQL verifier passed including complete workflow child owner/run/step metadata, authorized policy update, foreign owner rejection, invalid schema rejection without changing saved policy and restoration of original policy. The isolated database server was stopped. Full type verification remains running. Live settings remain unverified.
+
+Mounted original workspace-index/activity response contract using the existing authorized activity reader. Its workspaceId/userId envelope is derived from the shared session and validated workspace selector, separate from the plain activity response. Latest activity contract tests and route build are running.
+
+Indexed activity Worker build and six activity boundary tests passed. Mounted original Kody account GET and sync POST contracts using existing readKodyAccount and syncKodyAccount. Shared session/workspace membership precedes configuration lookup, source account policy denial preserved, sync receives server-derived live mode, account reads retain bounded cancellation signal. Route build is running, actual linked Kody account behavior remains unverified.
+
+Kody account route Worker build, full TypeScript check and four account HTTP boundary tests passed. Copied the complete original Kody community service, retaining public catalog search, typed projections, package detail execution, account access checks and account-change rejection. Only its environment type changed to the existing explicit KodyEnvironment. Community HTTP routes remain unfinished.
+
+Community service full types passed. Mounted original community search and listing GET routes under /api/chat, using shared account/workspace checks and original service inputs and 30-second cancellation. Worker build passed and seven original community/account tests passed. Full route type check pending. Live catalog and authenticated listing execution remain unverified.
+
+Community route full TypeScript verification passed. Copied original Kody usage service and its original tests, mounted usage GET through shared account authorization, preserving daily/weekly projections, account-change rejection and 30-second cancellation. Nine Kody usage/community/account tests passed. Latest usage route Worker build pending; live linked-account behavior is not verified.
+
+Kody usage route Worker build passed. Copied complete original Kody mail service and original tests; mounted inbox list, message search and message detail GET routes through shared account/workspace authorization. Original input projection, bounded cancellation, runtime code and account-change checks retained. Mail Worker build and twelve Kody tests passed. Full latest type check pending; no live inbox access has been verified.
+
+Mail route full TypeScript verification passed. Copied original package document service and mounted package document GET under shared account/workspace authorization. Preserves exact package/path matching, safe path checks, account-change rejection and 20,000-character excerpt limit. Original document tests plus account boundary tests passed (eight tests), Worker build passed. Latest full TypeScript check running; live package reads remain unverified.
+
+Package document full type check passed. Mounted original Kody resources GET using the previously ported service for subscriptions, webhooks, secret metadata, secret providers and sharing grants. Resource Worker build and all 21 current Kody read tests passed. These tests validate projections and mocked access contracts, not live accounts. Source provenance refreshed for the shared handler and all newly mounted Kody read routes.
+
+Mounted original Kody run history and run detail GET routes through shared account authorization. Existing ported services retained; original history filters, detail policy restriction and timeout durations preserved. Worker build and ten run/history/account tests passed. Latest full TypeScript check running. Live authenticated runs remain unverified.
+
+Run route full TypeScript verification passed. Mounted original memory search and detail GET routes using the existing ported memory service. Original query/default handling, account checks and 30-second cancellation preserved. Worker build and six memory/account tests passed. Latest full type check running. Memory mutations and live account reads remain unfinished.
+
+Memory read full types passed. Copied complete original memory change service, mounted create review/apply and existing-record review/apply POST routes. Preserves original bounded JSON reader, encrypted tokens, record verification and repeated account checks through original services. Worker build and ten original memory tests passed. Full mutation route types running; live writes remain unverified.
+
+Memory mutation full type check passed. Ported original Kody server add, server control and job control services. Native PostgreSQL membership/policy/link joins replace the original D1 binding queries, preserving source before/after account and policy comparison and desired-state changes. Full project types passed. HTTP control routes and native database/runtime checks remain unfinished.
+
+Mounted original job enable and server add/enable/reconnect/check POST contracts. Shared session, workspace policy and same-origin checks precede commands. Original service input schemas, timeout durations and conditional/unconditional catalog invalidations preserved. Worker build passed, full route type verification running. HTTP boundary tests and native/live service verification remain outstanding.
+
+Kody control route full TypeScript check passed. Five new HTTP boundary tests passed: signed-in scope overrides supplied identity, changed connections invalidate catalogs, unchanged commands do not, denied policy stops before configuration/mutation, cross-origin commands stop before auth, and invalid server IDs do not mutate. These mock service behavior; native authorization joins and live Kody mutations still require integration verification.
+
+Mounted original workspace and conversation reference GET contracts using existing ported listMessageReferences and catalogs. Original kind/query/excludeBotId parsing retained, conversation scope resolves through native identity, session supplies user. Worker build passed. Full types running; endpoint tests, refresh/inspect routes and live autocomplete verification remain unfinished.
+
+Reference lookup full types passed. Mounted original tool refresh, parallel Kody action/account refresh and reference inspection contracts. Source input schemas, allSettled handling and timeout durations retained. Worker build passed. Latest full type check running; HTTP boundary tests and live autocomplete/catalog behavior remain unverified.
+
+Reference catalog full types passed. Seven reference HTTP boundary tests passed for session scope, conversation ownership, duplicate workspace rejection, unsupported kind rejection, action/account refresh calls, original account-refresh failure tolerance and same-origin rejection. Services are mocked here; live picker, native catalog persistence and external refresh still require verification.
+
+Copied original Kody run triage service and mounted triage POST with bounded body parsing and shared account/workspace checks. Original desired-state receipt validation and before/after account checks retained. Worker build and eight original triage/control boundary tests passed. Full types running, live mutation remains unverified.
+
+Mounted original conversation file import POST using native SavedFiles.importFrom. Original immutable file IDs, expected SHA-256, bounded JSON and request cancellation retained. Worker build passed and five file HTTP tests passed, including source/target parameters and server-owned identity. Full types running; live R2 import remains unverified.
+
+Copied original conversation memory API, preserving preference GET/POST, list filters, read and command dispatch, private no-store responses and original input/error handling. Removed D1 argument in favor of existing native Memories. Mounted collection/detail under shared TanStack conversation identity. Worker build passed. Full types and live memory UI verification pending; original SQLite API test cannot be treated as native PostgreSQL proof.
+
+Six memory HTTP boundary tests passed for original filters/private responses, session-owned scope, memory reads, preferences dispatch, command payload, cross-origin denial and invalid pagination. Full memory types still running. Server file audit found semantic-history missing, copied its complete original experimental helper with explicit Cloudflare storage and Typesafe environment types. Original helper is not wired into normal execution and this port does not enable it. Its type verification remains pending.
+
+Conversation memory full types passed before experimental helper addition. Helper type check found original .ts import extensions incompatible with destination config and the copied explicit API key made optional incorrectly; normalized imports and retained required key. Mounted original paired MCP contract GET dispatch including trusted-discovery gating and paired-reader availability. Worker build passed; corrected full types running. Live contract reads remain unverified.
+
+Corrected history helper and MCP contract full types passed. Ten reference/catalog/contract HTTP boundary tests passed, including untrusted discovery rejection, missing paired-reader status and bounded MCP calls. Full consolidated harness suite passed: 191 test files, 1,987 tests. This does not prove live UI, deployed Cloudflare bindings or external accounts; those remain required before consolidation completion.
+
+Mounted device account GET/POST and dedicated device transport POST under /api/chat using existing native connected-devices service. Account commands use shared session/same-origin, transport retains separate bearer credential verification. Worker build and three boundary tests passed. Full types running, desktop URL integration and live device/native persistence verification remain unfinished.
+
+Client endpoint audit found settings sign-out still posting to obsolete Gum /auth/logout. Replaced with existing TanStack authClient.signOut, clear execution account only after successful response, then navigate to shared login. Latest full types running. Kody link/unlink still reference source OAuth paths and need shared-account connection wiring; AppUpdates version endpoint also remains unmounted.
+
+Ported Kody unlink to shared TanStack account identity and native link deletion, original credential removal preserved. The source email-login prerequisite is removed because TanStack identity exists independently of this integration. Client now calls /api/chat/kody/unlink. Worker build passed, full types running. Sign-out type check revealed shared authClient returns void and owns navigation to /auth/signout; removed the assumed response check and competing /login navigation. Kody connect/callback remains unfinished.
+
+Four unlink boundary tests passed: session-owned identity, preserve other credentials, repeated unlink without credential writes, cross-origin denial and unsigned-account denial. Source/client provenance refreshed. Initial unlink type check still observed the previously fixed void sign-out response issue, corrected full type process remains running. OAuth connect persistence audit found original pending/config tables are not yet in native chat schema, so direct native persistence is required before mounting source connect/callback. No existing auth bypass or Gum session will be introduced.
+
+Corrected shared sign-out/unlink full types passed. Added native OAuth client registration and expiring pending connection tables with migration 0037, plus original registration-winner and atomic consume semantics adapted to PostgreSQL. Pending consume additionally binds shared user identity. Added native verifier checks for owner isolation, expiry, one-time consume and registration winner; they have not yet run. OAuth store type check running. Connect/callback routes remain unfinished.
+
+### Native OAuth persistence verification
+
+Ran the complete workspace verifier against a fresh isolated PostgreSQL database, `tanchat_test_oauth_0930_v2`, including migration 0037. It passed the OAuth registration winner, pending owner isolation, single consumption, and expiry checks, along with the existing workspace checks. This verifies persistence, not the live Kody browser authorization flow. Production migrations were not applied.
+
+### Kody connection initiation source port
+
+Ported original PKCE registration and connection initiation to shared TanStack identity and native OAuth persistence. Preserved the normal Kody login redirect for 2FA and copied the original popup completion helper. Full project TypeScript check passed. The callback is still unfinished, so the initiation handler is deliberately not mounted and the client connection action has not been switched yet. No live OAuth success is claimed.
+
+### Kody callback source port
+
+Ported the original connect-only callback to shared TanStack sessions and native PostgreSQL. Added the original `jose` dependency for signature verification. Full project TypeScript check passed. Routes remain unmounted until boundary tests and concurrent account-link collision handling are complete. Live authorization has not been verified.
+
+### OAuth routes connected
+
+Seven connection and callback boundary tests passed, covering shared identity, browser state, issuer, expiry, encrypted PKCE ownership and the 2FA login redirect. Full project types passed before route generation. Account-link insertion now uses both uniqueness constraints without allowing ownership replacement. Mounted connect/callback routes and switched the original popup form to the native endpoint. Live JWT exchange and browser authorization remain unverified.
+
+### Release detection runtime wiring
+
+Mounted the original AppUpdates component inside ChatShell and adapted its version endpoint to /api/chat/app-version. Ported source content hashing into destination Vite config so production builds no longer report development. Original version comparison test and production build passed. Live upgrade prompt behavior remains unverified.
+
+### Mobile runtime and offline scope
+
+Mounted the original MobileRuntime in ChatShell and ported the original public offline worker/page under /chat/. Registration and navigation handling are scoped to /chat/ so other TanStack pages retain their existing behavior. The actual worker test passed for chat fallback and ignoring API, auth and other site navigation. The prior full project type check completed successfully. Browser installation, viewport behavior and offline transitions still need live verification.
+
+### Electron source port
+
+Copied the original desktop host, preload bridge, connected-device transport, native folder helper source, update controller, window lifecycle and tests. Adapted production launch to https://tanstack.com/chat and device APIs to /api/chat. Uses TanStack application identity/profile and TANSTACK_APP_URL / TANSTACK_UPDATE_URL configuration. Built the native helper and all 17 original desktop tests passed before the configuration-name cleanup. Packaging, signing, update hosting and live Electron/shared-auth verification remain outstanding. Source hashes are in tanchat-desktop-port.json.
+
+### Scheduled sync recovery restored
+
+Found the original scheduled workspace recovery was not wired to TanStack cron. Restored it on the existing minute cron alongside the existing workflow sweep, using shared host/database context. Missing native bindings report failure instead of silently skipping recovery. Eight scheduler/publisher tests and the full project type check passed. Live Cloudflare scheduled execution remains unverified.
+
+### Shared-auth live verification attempt
+
+The current checkout now has DEV_SESSION_TOKEN and DATABASE_URL configured. No local ENCRYPTION_KEY, AI_GATEWAY_ID, AI_GATEWAY_ACCOUNT_ID or TYPESAFE_API_KEY values were found, checked by name only. Started the actual TanStack dev server, which selected localhost:3001. Initial browser navigation to /chat timed out without a completed page, so shared-auth rendering remains unverified. The server is still running and should be inspected rather than restarted merely because navigation timed out.
+
+### Live route and auth evidence
+
+Rechecked the same running server. /chat returns HTTP 307 to /login?returnTo=%2Fchat, and the redirected page returns HTTP 200. The real browser visibly renders the existing TanStack GitHub/Google sign-in form. DEV_SESSION_TOKEN is written by the CLI helper but is not consumed by current web auth code, so its presence is not proof of browser authentication. No auth bypass was added. Authenticated workspace rendering still requires the normal shared sign-in flow, and local encryption/gateway configuration remains incomplete.
+
+### Chat deployment schema gate
+
+Added read-only db:verify-chat to both existing manual and CI Cloudflare deployment preparation. It checks all 63 chat tables and declared required columns/nullability from the shared Drizzle schema. The gate correctly rejected the earlier isolated fixture because its verifier omitted migration 0014 (Kody refresh claims). Corrected that migration sequence, reran the complete workspace verifier on a fresh isolated database, and the full verifier plus all 63-table schema check passed. No production migrations or deployment were run. This gate checks relations/columns, while the existing Builder gate checks migration history; live chat behavior still requires separate verification.
+
+### Appearance lifecycle integration
+
+Found AppearanceSync was not mounted in ChatShell. Mounted the original synchronization and added route cleanup that restores only the root CSS properties, appearance attributes and theme-color metadata changed by chat. This retains source root theme support for body portals while restoring the shared site when leaving chat. Six original appearance tests and full project types passed. Rendered theme switching and route-exit cleanup remain unverified in an authenticated browser. Component styles still require a complete isolation audit.
+
+### Source file coverage audit
+
+Compared the current source filesystem directly with src/chat. All core, client and component files have corresponding destination paths. Six server paths do not: auth/email auth are replaced by shared TanStack auth plus split Kody handlers; api.ts is split into TanStack routes; conversation identity uses the native resolver; the development-backend proxy is intentionally replaced by the shared runtime; appearance-html.ts still needs its authenticated initial-paint integration accounted for. File presence does not prove behavioral completeness. Current counts and missing paths are saved in tanchat-source-coverage.json. Shared TanStack manifest and icons replace source app branding assets, with offline assets scoped under /chat/.
+
+Full accumulated harness regression run passed: 197 test files, 2004 tests. This is automated source behavior coverage, not proof of live Cloudflare, shared-auth browser execution, signing, or release completion.
+
+### Shared sign-in cleanup
+
+Removed the unused source SignIn component, which still referenced Gum email/local-email and /auth/login routes. App already imports TanStack SignInForm, and no source imports of the removed component were found. Authentication stays owned by shared TanStack auth. Initial authenticated appearance painting remains unfinished; the original HTMLRewriter behavior cannot be claimed as ported by the currently mounted appearance effect.
+
+### Component stylesheet isolation
+
+Found the 59 component stylesheets were still global even though the main chat stylesheet was scoped. Wrapped their original rules in the same native CSS document scope, active only while .tanchat-shell is present. This preserves the original body-mounted portal styling and disables the rules on other TanStack routes even if their CSS remains loaded. Production build passed. Rendered popover/dialog behavior and route-exit styling remain browser verification requirements. Updated CSS provenance hashes and adaptation notes.
+
+### Local chat secret configuration
+
+Configured a fresh ENCRYPTION_KEY in the ignored local env file and reused the already authorized source TYPESAFE_API_KEY for Jev, without printing values. Set local env file permissions to owner read/write. Source gateway settings were not copied because the source and TanStack Cloudflare account IDs differ. TanStack gateway configuration, local MCP egress, authenticated UI testing and production secret provisioning remain outstanding. No production secrets or account permissions were changed.
+
+### Local MCP network relay
+
+Ported the exact original local-mcp-egress source and its Miniflare runtime dependency. Shared Vite starts the relay in serve mode, injects its ephemeral endpoint/token into worker vars, and disposes it with the dev server. Both original relay tests passed. The running Vite process restarted after configuration changes. Real authenticated MCP calls remain unverified.
+
+### MCP deployment/build configuration
+
+Restored the original compile-time local development flag and Cloudflare public egress assertion in trusted deployment configuration. The first type check identified lost contextual typing after async Vite startup; fixed it by typing the returned config as UserConfig, without casts. Final full project types passed, and the production build passed. Real MCP calls and Cloudflare deployment remain unverified.
+
+### Catalog detail and preview route fidelity
+
+The original API supports plugin and skill IDs in the URL path. The initial TanStack route split only mounted their collection routes, leaving the existing UI detail/version requests and plugin preview URL unmatched. Mounted both detail routes and passed their path IDs to the original pluginApi and skillApi services. Also reject duplicate workspace parameters before policy lookup. Seven HTTP boundary tests passed, covering detail/version request forwarding, shared account identity, preview dispatch, duplicate workspace rejection and cross-origin writes. The generated route tree includes both routes. Live authenticated catalog behavior still needs browser verification.
+
+### Connection-time Kody inventory sync
+
+Found another source behavior missing from the OAuth port: the original callback schedules syncKodyAccount immediately after connecting. Restored that callback step using the existing shared host background lifetime, native personal workspace creation, current workspace policy and the original sync service. Runtimes without background scheduling await the same operation once. Sync failures are logged without invalidating the established connection. Seven sync/callback boundary tests passed. The prior catalog route full type check also completed successfully. A real OAuth success and refreshed catalog still need live verification.
+
+### Production Builder tool reuse
+
+Confirmed the source browser execution bridge is development-only, so copying it cannot replace the production Builder harness by itself. Extracted Builder's actual nine-tool workspace factory and its conversion/npm resolution helpers into builder-workspace-tools.server.ts. The existing Builder route now imports the same factory. Verified the extracted factory body is identical to the checked-in implementation, apart from its export keyword, and recorded its source revision/hash. Full project types and the existing workspace/progress/package-resource tests passed. TanChat still needs project state, tool registration and the existing execution/preview UI connected to this factory before the separate Builder loop can be removed.
+
+### Shared project discovery in TanChat
+
+Connected the conversation tool registry to Builder's existing native project store. User-origin turns in a personal workspace now expose list_projects and inspect_project, with exact conversation access checked on every invocation and ownerId supplied from the authenticated scope. Project metadata stays separate from chat files and threads. No duplicate project tables or storage implementation were introduced. Five focused tests passed for owner-scoped listing, existing ownership checks, company workspace denial and revoked conversation access. Project editing, snapshot contents and execution/preview UI are still not connected, so this is not yet a replacement for the Builder harness.
+
+### Shared project snapshot contents
+
+Extended inspect_project to report runtime, entry and readable paths from the actual stored Builder snapshot. Added read_project_file using the existing Builder file access rules and paginated reads. Snapshot reads reuse the existing R2 object/quarantine lookup, canonical validation and byte limit, and verify the content hash before parsing. Twelve focused tests passed, including real gzip round-trip, corruption rejection, decompression limits, hidden-file restrictions and ownership boundaries. Confirmed the original assistantToolDiscovery inventory includes these tools and passes their descriptions into the existing tool directory and load_tools flow; no task-specific routing was added. Project mutations and execution UI remain outstanding.
+
+Project file type checking initially found the adapter's optional defaulted offset and the cross-platform stream input type. Fixed the offset default and normalized stream chunks to owned BufferSource buffers, with no casts. Final full project types passed. The thirteen final focused tests also verify that load_tools exposes project schemas through the real progressive disclosure flow without executing reads.
+
+### Project edits through the existing Builder implementation
+
+Added replace_project_file to the existing discovery inventory. It invokes the extracted, unchanged Builder replace_file tool, stores the resulting snapshot through the existing owner quota/registry service and commits through updateBuilderProjectState with an expected revision. Current project metadata is preserved. Tool-call/task identity uses the existing stable operation ID helper. Added an owner-checked read of Builder's existing mutation receipts and revisions so a committed edit can be recovered without another snapshot or revision, including after a newer edit. Thirteen focused project tool tests passed. The isolated native PostgreSQL verifier passed real commits, receipt replay, ownership rejection, conflicting receipt rejection, stale revision rejection and exact earlier-revision recovery after a newer edit. No production database changes were made. Production UI editing, execution/preview and release verification remain outstanding.
+
+### Project editor integration
+
+The Projects side panel mounts the existing BuilderProjectPage and ExampleWorkbench. It keeps project stream reconciliation and waits for the existing pending-save flush before switching projects. Embedded mode leaves the separate Builder assistant unmounted. The panel is available only in the signed-in user’s personal workspace.
+
+Production bundling identified browser-only imports in the shared component graph. The panel now loads behind ClientOnly and a compiler-recognized isomorphic import boundary. The production build passed after correcting that boundary. Final type checking is being confirmed separately. Browser execution also still needs verification of isolation headers and OAuth behavior before retiring Builder routes.
+
+### Shared database and browser verification
+
+Normal GitHub sign-in succeeded from the port at localhost:3001. The existing OAuth configuration returned to localhost:3000. The first authenticated chat request exposed missing chat tables in the configured shared database. Read-only inspection confirmed only migrations 0000 and 0001 had been applied and no chat tables existed. Applied the tested pending Drizzle migrations using the normal migration runner, without deleting existing TanStack data. The read-only schema check then verified all 63 required chat tables.
+
+Reloading reached workspace onboarding and rendered the personal assistant sidebar. The localhost:3000 runtime then reported an InvalidCharacterError in @tanstack/redact while rendering an object component. Browser verification returned to localhost:3001 to distinguish that runtime issue from the port. Full authenticated conversation rendering and real model execution remain unverified.
+
+### Renderer compatibility investigation
+
+Authenticated chat also reproduced the object-as-HTML-tag failure on localhost:3001, using @tanstack/redact 0.0.21. Current Redact source recognizes React context objects as providers, unlike that installed release. Updated the official dependency to ^0.1.2 and its lockfile. Type checking passed. Restarted the confirmed Vite process to load the changed plugin dependency, then verified the replacement server became ready on localhost:3001. The signed-in browser remains available for continuing rendering verification, which is not yet proven successful.
+
+### Authenticated live conversation and project checks
+
+With Redact 0.1.2, the signed-in conversation rendered and completed a real included Kimi K2.6 turn, answering the arithmetic prompt with 4. A second natural-language request discovered and executed the file tool, saved consolidation-check.txt, and completed its final reply. The file preview showed the exact requested contents. A separate read of the committed shared PostgreSQL row confirmed ready state, assistant origin, 29 bytes, and a matching SHA-256 digest.
+
+The Projects panel listed existing owned Builder projects. One older snapshot was unavailable in local object storage. Creating a fresh project through the original Builder service succeeded. The existing editor and workbench mounted, compiled its browser template, and displayed its real iframe preview. Clicking Count changed 0 to 1. This proves the tested browser-template path, not WebContainer isolation or all project runtimes.
+
+The production build passed with the renderer update. Embedded editor adaptations prevent changing the chat title to TanStack Builder and remove the old Builder navigation link from embedded errors. Desktop execution, WebContainer isolation, Kody OAuth and tool execution, continuous deployment, and Builder route retirement still require completion.
+
+### Project panel state and access checks
+
+Added regression checks for the explicit personal-project panel gate, independence from desktop and Kody gates, and preserved project tab selection while hidden. These passed alongside the existing project tool contract checks. In the signed-in browser, compiled a fresh project, incremented its preview counter, hid the side panel, and reopened it. The same project, running preview, and Count 1 remained present, confirming no preview remount in this tested hide/show path. Embedded title behavior also now leaves the page titled TanStack.
+
+### Assistant project creation
+
+Added create_project to the existing assistant tool discovery directory. It uses the shared blank project starter, imports legacy owner project state through the existing service, checks creation replay before quota, preserves the existing daily project creation limit and legacy ID reservation, stores snapshots through the existing owner registry, and commits with createBuilderProjectState. IDs derive from the authenticated conversation scope, task, and tool call. There is no model-supplied owner identity and no automatic execution or deployment.
+
+Creation, replay, quota rejection, missing mutation identity, and cancellation checks passed along with the existing project tools, 18 tests total. Type checking and production build passed. A browser retry after hot reload returned a Redact SSR error where useMatch had a null router context. Live assistant creation therefore remains unverified, and this renderer/runtime issue must be resolved before declaring the port ready.
+
+### SSR module graph correction
+
+The SSR optimizer was prebundling the Router/Query bridge while other shared router modules remained live. Added the existing routerSsrPackages group to SSR optimizeDeps.exclude so shared provider and consumer modules remain in one graph. Optimizer metadata no longer lists the bridge. The signed-in page rendered again, then survived a real assistant server-module edit and browser reload. Type checking passed. A live normal-language create-project request was submitted after that reload; its final result still needs verification.
+
+### Shared project listing and live creation follow-up
+
+The assistant now lists projects through the original `listOrImportBuilderProjectStates` service, the same service used by the project picker. This preserves visibility of existing Builder projects instead of making assistant discovery depend on whether another UI has imported them first. All 18 focused assistant project tool checks passed.
+
+The SSR module-graph production build passed. The subsequent real signed-in project-creation request ended as interrupted, so live assistant project creation remains unverified. The development log also contains repeated durable-stream cancellation rejections, which still need a root-cause investigation. This is not evidence that the complete port is ready for release.
+
+### Interruption evidence corrected
+
+The repeated `Stream was cancelled` stack is from `postgres/cf/polyfills.js`, specifically its Cloudflare TCP socket reader. It is not a durable chat stream stack. The earlier description of durable-stream cancellation rejections was incorrect. The conversation constructor marks a saved running task as interrupted after a Durable Object restart. Current evidence does not establish that the PostgreSQL socket cancellation caused that restart. Development worker reloads are also present in the log. Avoid suppressing errors or changing interruption recovery without proving causality.
+
+The complete application typecheck passed after switching assistant project listing to the original shared import-and-list service. Builder tool provenance now records the completed panel and partial assistant integration separately from remaining runtime and release work.
+
+### Original Builder package tools connected
+
+TanChat exposes `inspect_project_module`, `search_project_package_resources`, and `read_project_package_resource` through its existing tool discovery. These call the unchanged original `createWorkspaceTools` implementations against an authorized saved project snapshot. No package resolver or resource parser was recreated. Conversation ownership, hidden-file rules, abort checks, source output bounds, and the existing TanStack-only Intent skill policy are preserved.
+
+The application typecheck passed, all 20 focused project-tool checks passed, and the original package-resource tests passed using the repository Node test runner. An initial Vitest invocation for the Node tests failed at configuration startup and was corrected to the documented runner. Live model use of the new tools remains unverified. Runtime upgrades and dependency writes still need their original revision-safe integration before the separate Builder harness can be retired.
+
+### Original runtime and dependency mutations connected
+
+`upgrade_project_runtime` and `install_project_dependency` now call the original Builder tools and save through the same owner, revision, mutation receipt, abort, and snapshot quota checks as file replacement. Runtime configuration is persisted with the workspace, including the original fixed install and start commands. The tools save source configuration, they do not execute installation or start a runtime. The three revision mutations share one commit path.
+
+All 22 focused project checks, 11 original workspace checks, and the full application typecheck passed. The typecheck caught optional-runtime and package adapter issues, both corrected without casts. Live execution of the upgraded runtime and dependency workflows remains unverified. The earlier package-tool typecheck claim was premature, its output later showed the adapter error now corrected.
+
+### Mutation replay and release build follow-up
+
+All 24 focused project checks passed, including exact dependency manifest contents, preserved authored code, and replay of committed runtime/dependency receipts without another snapshot or revision write. The consolidated production build passed after formatting the adapters.
+
+Live Chrome navigation currently shows `ERR_BLOCKED_BY_CLIENT` on the existing localhost test tab, including after reload. The development server remains listening on port 3001. No browser protection was disabled. Live creation, runtime execution, and original Builder route retirement remain pending.
+
+### Committed project changes refresh the picker
+
+The assistant emits the shared `tanstack.project.saved` event after a revision or creation commits, and when a committed receipt is replayed. TanChat handles it through TanStack AI `onCustomEvent` and invalidates the authenticated account project-list query. The existing Builder editor continues to use its own authoritative revision stream. No polling or tool-name inspection was added. Failed commits do not publish a saved event.
+
+All 25 focused project checks and the complete application typecheck passed. Added checks prove that a rejected revision produces no refresh event and a successful commit does. The actual browser refresh behavior remains unverified while the local browser check is blocked.
+
+### Initial appearance payload source port
+
+The original `appearance-html.ts` payload implementation is now present unchanged under chat/server. Wiring is unfinished. A direct port of the old HTMLRewriter middleware does not fit the shared host server types and TanStack auth identity, so that attempted middleware was removed. The shared document/rendering integration still needs to be implemented without recreating the source palette logic or adding a host-specific global shim. No initial-paint verification is claimed.
+
+### Shared initial appearance integration
+
+The original appearancePayload implementation is now called by a server-only shared-session adapter, using TanStack AuthUser.userId and the shared PostgreSQL account preferences. The /chat route loads that payload and renders the original appearance bootstrap through its route head before body content. Personalized chat documents use private/no-store browser and CDN cache headers. This avoids adding a Cloudflare HTMLRewriter shim to the shared server.
+
+The full application typecheck and eight focused appearance checks passed, including original resolved palettes and script-delimiter escaping. Production build verification is running. Visual first-paint verification remains pending, file presence and payload checks alone do not prove it.
+
+The production build for the shared initial appearance integration completed successfully. Live visual verification remains pending.
+
+### Broad regression verification
+
+The current destination worktree passed `pnpm run test:chat`: 204 files and 2,050 tests. It also passed `pnpm run test:unit`: 507 passing tests, two skipped, zero failures. These cover the ported harness contracts and existing site unit behavior, not a complete live product or deployment audit. Shared auth sign-out uses full document navigation, so the old document and in-memory loader state are discarded.
+
+Remaining release requirements still include real project creation and editing through the assistant, upgraded runtime execution, OAuth and MCP connections, original Builder harness retirement and redirects, Electron runtime/release verification, and production infrastructure deployment. No goal completion or live readiness is claimed from the regression suites.
+
+### Cloudflare deployment dry run
+
+Wrangler 4.103.0 successfully completed deployment dry-run validation of the current production build, without uploading. The built worker has the StreamObject, WorkspaceSync, Conversation, TanChatWorkflow, storage, AI, and static asset bindings. It contains 899 modules and 1,024 client assets, with 8,577.56 KiB compressed worker upload size. This is package/configuration evidence, not proof of production startup, provisioned Durable Objects, secrets, OAuth, or a successful live deployment.
+
+The R2 inventory command required explicitly selecting the configured TanStack account in this multi-account login. No reauthentication or infrastructure mutation was performed.
+
+### Project selection is a typed chat destination
+
+The shared workspace search schema now accepts an exact project UUID. The Projects panel reads and updates that destination through the existing router instead of keeping the selection only in component state. Selection changes still flush pending editor changes before navigating. Hiding the panel preserves the project destination, invalid project values are discarded, and the existing server owner checks still control access. This provides a destination for eventual Builder project redirects, those redirects are not yet enabled.
+
+The complete application typecheck and 22 focused panel/navigation checks passed. Live reload and navigation verification remain pending. The CI deploy script already reaches chat schema validation through db:prepare-builder, so no redundant release script was added.
+
+### Authenticated project entry route
+
+`/chat/project/` now resolves the shared authenticated personal workspace and assistant, then redirects into the existing Projects panel with the exact project destination in typed search state. Anonymous users retain this destination through the existing login returnTo flow. Invalid UUIDs produce not-found. The project editor remains the original Builder component and backend.
+
+Production build and generated route registration passed. Original Builder routes remain pending retirement, including a separate decision for public project viewing, and the new entry flow still requires live browser verification.
+
+### Public snapshot viewer under chat
+
+`/chat/p/` ports the existing public Builder snapshot route, with the same SharedExamplePage, client-only runtime boundary, and WebContainer headers. It does not force public viewers into the personal workspace login flow. The shared viewer uses project terminology for its run and error labels. The generated route and production build passed before the copy-only label change. The prior authenticated project entry typecheck completed successfully.
+
+The old public Builder snapshot route is still available until live runtime verification and redirect activation. This addition preserves the public-viewing requirement rather than silently narrowing consolidation to signed-in owners. Visual checks and WebContainer execution remain pending.
+
+### Shared snapshot endpoint mismatch repaired
+
+The original share helper still posted snapshot JSON to the newer project-record endpoint, and the public viewer fetched a project record where it expected snapshot JSON. Sharing now reuses the existing storeBuilderProjectRevision snapshot client, and viewing reuses getBuilderProjectSnapshot. Large shares return /chat/p/; small compressed fragment shares use /chat/shared without an upload. The existing encoding, snapshot parser, storage quotas, and authentication remain in use. No replacement storage implementation was added.
+
+The production route build and both sharing contract checks passed. Checks cover inline encode/decode and large-share storage routing. The full typecheck is running, and live UI/viewer verification remains pending.
+
+### OAuth completion across browser isolation
+
+AuthPopupForm now creates a unique BroadcastChannel for each OAuth attempt and submits its UUID with the existing same-origin request. The Kody connect handler stores it in the encrypted pending payload, and the callback validates and uses that saved identifier after the existing state, cookie, PKCE, token, and shared-session checks. Completion still only invalidates authenticated bootstrap data; no token is sent through the channel. Existing opener postMessage completion remains available. The closed-window polling was replaced by the pending attempt expiry timeout, because COOP can detach a still-open popup. WebContainer isolation is not yet enabled for chat, live completion still needs verification.
+
+Four focused completion/sharing checks passed. The earlier sharing typecheck found that the original snapshot client returns a hash string rather than an object. Its caller and mock were corrected; the final typecheck is running.
+
+### Shared login isolation approval boundary
+
+Inspection found a second opener dependency in the shared Google/GitHub LoginModal flow. Enabling COOP for chat before fixing it could break modal login. The proposed change carries a unique completion channel through the existing OAuth popup cookie and callback, then invokes the existing modal completion callback. Existing state, session, and returnTo validation would remain.
+
+Automatic approval review rejected the attempted shared-auth update before the command ran, citing substantial authentication disruption risk and missing explicit authorization for that implementation. No shared OAuth edits were applied. User approval was requested. Chat isolation and the dependent WebContainer live checks remain pending. Other consolidation work is still possible, the full goal is not blocked or complete.
+
+### Desktop package artwork
+
+The ported Electron Builder configuration now reuses the existing 600 by 600 TanStack logo from the website instead of packaging the Kody koala. The historical assets remain attributed and are not active package inputs. This is a packaging change, not evidence of a signed or notarized release.
+
+### Desktop host verification and packaging gap
+
+Rebuilt the original native folder helper and reran all 17 ported desktop tests, all passed. Coverage includes account isolation, folder grants, authentication popup isolation, multi-window IPC ownership, update lifecycle, and the consolidated /chat launch path. The unsigned package command failed before packaging because electron-builder is not installed. The site pnpm workspace currently includes only the root package, leaving desktop dependencies outside the installation and lockfile. Desktop workspace/install integration still needs to be completed before packaging and live launch can be verified.
+
+### Desktop workspace integration
+
+Added desktop to the existing pnpm workspace and shared lockfile. Inspected electron-winstaller install script, it copies its bundled architecture-specific 7-Zip executable and DLL, and explicitly allowed it in the existing allowBuilds policy. pnpm install completed successfully. The local pack command progressed through Electron 44.4.5 download, native dependency rebuilding, app assembly, and signing with an available Developer ID identity. Although forceCodeSigning=false permits unsigned builds, Electron Builder automatically discovered a signing identity. Process session 44119 was still running at the latest observation, packaging completion and notarization are not yet proven. No package has been published.
+
+### Desktop package assembled
+
+The same local pack process completed with exit 0. Inspected the actual app Info.plist: TanStack name and executable, com.tanstack.desktop bundle identifier, version 0.1.3, and generated icon.icns. Inspected app.asar with the installed Electron archive reader: main.mjs entry, original preload.cjs and connected-device.mjs are included, and runtime-config.mjs launches https://tanstack.com/chat. nativeUpdates=false for this package because no update host was configured. Electron Builder explicitly skipped notarization because notarization options could not be generated. This package is not a verified distributable release and has not been published.
+
+### Legacy chart playground capability
+
+Inspected /builder fragment behavior before redirecting: #project loads the shared project viewer, #code loads the existing ChartsBuilderPage, and ordinary /builder loads the old harness. Added /chat/charts using the exact existing ChartsBuilderPage component and original browser runtime headers, no replacement chart implementation. The original fragment encoder and decoder remain unchanged. Old /builder routes are not yet redirected, public preview isolation and shared authentication still need coordinated verification.
+
+### Desktop development and test commands
+
+Added root dev:desktop, pack:desktop, dist:desktop and test:desktop commands, and included desktop checks in the existing repository test pipeline. The desktop dev command now invokes the declared Electron package’s own install-electron CLI before launch, since Electron 44 has no automatic postinstall download. The installer completed successfully and all 17 desktop tests passed through the new root command. Added desktop/README.md with actual development, packaging and release configuration. Live application sign-in and browser interaction remain unverified.
+
+### Database lifetime investigation
+
+Current shared database code creates one lazy Postgres.js pool per AsyncLocalStorage context in Cloudflare, with up to five connections, and retains the context in asynchronous descendants. Conversation.runWithRuntime wraps RPC operations, but trackExecution and kickQueue also schedule work directly with the Durable Object waitUntil context. Closing the pool immediately when the RPC function returns would race that continuing work, so a blanket finally/client.end change is not justified.
+
+The checked-in Wrangler configuration has no Hyperdrive binding. The shared host resolver supports Hyperdrive, but currently falls back to DATABASE_URL. Cloudflare’s documented automatic connection cleanup applies to Workers-to-Hyperdrive connections, not proof that this direct Neon socket lifecycle is correct. Its Durable Object guidance also warns against long-lived idle database clients. Next verification needs to distinguish direct connection teardown errors from worker reload cancellation, and cover a response that finishes while its background execution continues before changing shared database lifecycle code.
+
+Sources: https://developers.cloudflare.com/hyperdrive/concepts/connection-lifecycle/ and https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/postgres-js/
+
+### Database context boundary checks
+
+Added four checks against the actual shared db/client module with mocked transport: lazy invocation without queries, nested client reuse, concurrent invocation isolation, and asynchronous descendants continuing after the request callback returns. All four passed. This confirms why request-return cleanup alone would be unsafe. These are context ownership checks, not live socket teardown proof, no connection lifetime implementation was changed.
+
+### Shared site navigation entry points
+
+The full repository test:tsc command completed with exit 0 before this navigation-only edit. Both existing authenticated account menus previously sent users to the old /builder harness under My Projects. They now link to /chat as TanChat using the existing Phosphor chat icon. The old Builder routes remain available until capability retirement checks pass. Rendered menu verification is still pending because the prior browser test was blocked by Chrome.
+
+### Shared lint gate audit
+
+The existing type-aware lint gate failed with 275 errors and 101 warnings. The passing main TypeScript check excludes harness-tests and scripts, so it did not establish those files were correctly integrated. Twenty-nine diagnostics referenced the removed source global Env type. Corrected the provider observation adapter test to import its actual ProviderEnv contract from the ported providers module. The remaining lint diagnostics still need fixes, the release gate is not passing and has not been suppressed. Browser verification was retried against the running localhost:3001 server and Chrome again returned ERR_BLOCKED_BY_CLIENT before page load.
+
+### Ported test environment repairs
+
+Removed references to the old global Env from execution gate, MCP public egress, Jev routing, Kody run tools, Kody memory tools, Kody setup readiness and Kody memory creation tests. Optional environment settings use the actual narrow exported contracts, and Kody fixtures provide the required origin and encryption key instead of casting empty objects. All 41 checks across these seven files passed. This fixes test integration without weakening lint rules or adding a global compatibility type. Other lint failures remain.
+
+### Desktop lint integration
+
+Converted the ported Electron Builder configuration from CommonJS to ES modules, reusing the same configuration and release validation logic. Updated package commands, verified config import and native helper build, and excluded the build-only config from app.asar. Removed an unused counter from the original mocked device test. All 17 desktop tests passed again. The PostgreSQL verifier still has real type errors in its fixtures and row handling, no blanket exclusions or lint suppression were added.
+
+### File storage fixture contract repairs
+
+The PostgreSQL verifier’s R2 mock omitted the required checksum toJSON method. Updated it to use the installed Cloudflare R2Checksums contract and serialize the computed digest. Focused lint confirms its three storage contract errors are gone, 65 other verifier errors remain. File HTTP tests now supply a valid FileEnvironment and the current content result arrayBuffer method instead of the old global Env and incomplete content mocks. All seven file HTTP boundary checks passed. No live database verification was rerun against a production account.
+
+### Verifier fixture narrowing
+
+Repaired MCP fixtures to include content alongside structuredContent, removed casts on their call functions, preserved the required model connection when updating Kody credentials, asserted the existing Kody account before modifying it, narrowed an unknown skill result before reading ok, and encoded a plugin package as a JSON string parameter with PostgreSQL jsonb conversion. Focused lint dropped from 65 to 58 errors before the final analogous MCP fixture repair. The database verifier was not executed, its runtime behavior and remaining type failures still need verification.
+
+### Verifier TypeScript project
+
+Added scripts/tsconfig.verify.json covering all chat consolidation verifiers and the original Builder schema verifier, with the actual shared aliases, ambient declaration files and generated router types. Initial checking exposed real missing credentials, incomplete activity projections, un-narrowed reference unions and incomplete mocked MCP results. It also exposed missing ambient declarations in the verifier project, corrected its includes rather than adding compatibility globals. The activity fixture now uses the original projectBotActivity function to produce its required fingerprint and message bookkeeping. This project is not yet passing or wired into the release pipeline.
+
+### Consolidation verifiers type check passes
+
+All chat database consolidation verifiers and the original Builder schema verifier now pass TypeScript checking together, exit 0. The project uses the standard scripts/tsconfig.json filename so tools can discover its real declarations. Added this check to the existing root test:tsc command, which is already part of CI. Fixed Kody credential fixtures to carry their required included connection, narrowed reference kinds before specific fields, supplied complete MCP responses, and typed deferred results with the real kodyCall return contract. This is compile-time verification, actual isolated database runs and full lint remain separate gates.
+
+### Real local PostgreSQL verification
+
+Ran all three native database verifiers against separate, empty PostgreSQL 17 databases on a task-owned loopback-only cluster. The Kody refresh and project edit verifiers passed. The full workspace verifier initially failed because its manually inserted plugin preview fixture used an already serialized string as an inferred JSONB parameter. PostgreSQL.js encoded that string again. The fixture now declares the serialized parameter as PostgreSQL text before the explicit JSONB conversion, including the equivalent retry source fixture. This changes verifier inputs, not production package parsing.
+
+The complete workspace verifier then passed against a new empty database. Evidence: `/private/tmp/tanchat-workspace-live-verify2.log`, `/private/tmp/tanchat-refresh-live-verify.log`, and `/private/tmp/tanchat-project-live-verify.log`. These checks cover native persistence and concurrency contracts. They do not prove rendered UI behavior, live model execution, production deployment, or the pending shared OAuth changes.
+
+### Ported test contract follow-up
+
+Removed the remaining old global `Env` casts from the model selection and attachment test fixtures. They now use the native `ModelEnvironment` and `AttachmentEnvironment` contracts. The deliberately missing model case remains covered as an explicitly invalid runtime input. The offline worker test now declares its fetch event contract instead of using `Function`. Focused verification passed: 39 model-selection checks, 11 attachment checks, and the offline navigation/cache boundary check. This does not establish that the entire repository lint gate is clean.
+
+### Legacy project entry points
+
+The old `/builder/p/$hash` route now redirects to `/chat/p/$hash`, preserving the public snapshot hash and reusing the original shared viewer already mounted there. The old `/builder/$id` route now redirects to `/chat/project/$projectId`, which opens the project in the assistant's project panel through the existing shared sign-in flow. Both use history replacement. The root fragment-based Builder links and template creation entry point still need their own migration before the entire old harness can be removed.
+
+The `/builder` root now redirects into TanChat. Its original `#project=` snapshots are preserved at `/chat/shared`, and original `#code=` chart payloads are preserved at `/chat/charts`. The ordinary index opens `/chat`. The route remains client-only so URL fragments are available before choosing the destination. This removes the old Builder index from the root entry point, while the original viewer and chart components continue to handle their payloads. Type verification for the earlier project and snapshot redirects passed; verification of this additional root change is in progress.
+
+The Builder root redirect TypeScript check passed. TanChat's project panel now offers the existing Builder template catalog, using `createBuilderProjectFromTemplateId` and the same `createBuilderProject` save API. It preserves the existing save-before-switch behavior and does not introduce a second project creation backend. Type verification for this panel change is running. The old draft page and its separate assistant are still present pending full retirement; rendered validation is also still required.
+
+The project panel template integration passed TypeScript verification. The old `/builder/ai` standalone assistant entry point now redirects to `/chat`, using TanChat's conversation engine. The original Builder project draft/template tests also passed. The old draft route, old assist API, and unused assistant implementation still need removal or consolidation after their remaining callers are accounted for.
+
+### New project entry consolidation
+
+`/builder/new` now redirects to `/chat/new-project` with its template query preserved. The new route uses TanStack's existing current-user and login-return flow, then opens the assistant's Projects panel. Template selection lives in the existing workspace navigation state, so an already mounted panel receives the selection correctly. The user confirms creation with the panel's New project button, which uses the original template constructor and project save API. This changes the old local-draft-first entry experience to the consolidated saved-project flow. No existing user draft migration is promised, consistent with the fresh-data scope. The old draft and standalone AI pages are no longer routed, but the old assist API and unused code still require retirement. Rendered verification remains pending.
+
+### Old assistant endpoint retirement
+
+Removed the old model execution loop from `/api/builder/assist`. It now returns HTTP 410 with the TanChat destination, rather than preserving a separate executable harness or pretending the two wire protocols are interchangeable. The original request parser, validation helpers, and BYOK boundary were moved unchanged into `builder-ai-request.server.ts`; their existing tests now import that module. Remaining dead Builder assistant UI code still needs pruning, but the old API can no longer invoke a model.
+
+The reused project editor's fallback fork navigation and Back links now point directly to TanChat, rather than sending users through legacy redirects. All 17 workspace navigation checks passed after the template search-state addition. Type and focused lint checks for the latest retirement changes are running; live browser verification remains pending.
+
+### Current browser and shared OAuth verification limits
+
+Rechecked the live local renderer, which is listening on localhost port 3001. Chrome still rejects navigation with `ERR_BLOCKED_BY_CLIENT`; no browser protections were changed or bypassed. The full TypeScript check following old assist API retirement passed. A new Cloudflare production build is running to verify the replacement routes and bundles.
+
+The shared OAuth completion-channel implementation was attempted once after approval evidence arrived from the sibling chat. Automatic approval review rejected execution because that evidence was tool-delivered rather than a direct user message in this chat. None of the proposed shared OAuth edits ran. A direct confirmation is pending here. Other consolidation work continues.
+
+The Cloudflare production build after Builder route and API retirement completed successfully. Evidence: `/private/tmp/tanchat-builder-retirement-build.log` and the current `dist/server/index.js` artifact. This proves compilation, not deployment or live sign-in.
+
+The project editor no longer imports the old Builder assistant at runtime or offers its alternate chat view. TanChat retains the original workbench and project synchronization. Historical sync type imports remain, and now-unused assistant transaction helpers still need cleanup. Type verification of this additional editor change is running.
+
+Removed the old assistant's now-unreachable apply/validate/commit/restore transaction helpers and their state guards from the reused project editor. The ordinary save queue, working-copy recovery, pending save receipt handling, external revision conflict detection, and synchronization hydration remain. Focused type-aware lint reports zero warnings and errors. The original bootstrap, working-copy, sync outbox, and sync client test suites passed. Full TypeScript verification of this cleanup is running.
+
+Removed the four unrouted old harness UI files: BuilderAssistant, BuilderAiSpike, BuilderIndexPage, and BuilderProjectDraftPage. Each was clean in Git before removal, and searches found no remaining callers after replacing the project editor's last type dependency. The retained editor's live subscription now reads only the project row and invokes the existing reconciliation handler, instead of assembling unused assistant thread/message/run arrays. Focused type-aware lint passed. Full TypeScript verification is running. Original source remains recoverable in Git, but these old UI implementations are no longer part of the current application.
+
+Type verification after removal of old assistant UI is still running on the original process handle. The final ESM Electron packaging configuration is now being exercised by an unpublished local package build; the earlier package was built before this configuration rename, so it was not sufficient evidence for the final configuration.
+
+The full TypeScript check after removal of the old assistant UI completed successfully. The final Electron packaging run has reached Developer ID signing, with publishing disabled; package completion and signature verification are still pending.
+
+The final ESM Electron package build completed successfully with publishing disabled. Developer ID signing completed, and strict deep signature verification passed for `dist/desktop/mac-arm64/TanStack.app`. Its display name is TanStack and bundle identifier is `com.tanstack.desktop`. Notarization was explicitly skipped because credentials were not configured. This is a verified local signed package, not a notarized public release or a tested live desktop session.
+
+The complete repository lint gate currently reports 100 warnings and 165 errors. Renamed the server's `usePlugins`/`usePlugin` locals to `activatePlugins`/`activatePlugin`, because these are asynchronous activation functions, not React hooks. Public tool names and execution behavior are unchanged. Focused server lint now has no errors, with four remaining unused-code warnings. Also corrected immutable schedule result and preview bindings. The broad gate is still incomplete.
+
+Connected the ported Location, Running process, and Repeat labels to their real SelectField triggers using component-scoped React IDs. The schedule kind callback now accepts only the three supported choices instead of casting an arbitrary string. Focused lint confirms the form-label errors are resolved; the schedule form's existing autofocus issue remains, so this is not a claim that all UI accessibility lint is clean. Rendered validation remains blocked by Chrome's localhost restriction.
+
+### Harness test type coverage
+
+Added `harness-tests/tsconfig.json` for the original ported core tests and included it in the root `test:tsc` command. The ordinary app typecheck explicitly excludes this directory, so successful test execution previously did not establish that its fixtures matched native contracts. The new check uses the same strict application settings and source declarations, with a separate incremental cache. Its first complete run is in progress, and any failures remain part of the consolidation gate rather than being hidden by exclusions.
+
+The first strict harness test type run found 121 errors. One exposed a genuine coverage gap: Vitest's workflow `it.each` rows spread the graph's steps as individual callback arguments, but the callback treated the first step as the whole graph. Those cases rejected the wrong shape rather than proving graph validation. The table now wraps each graph as a named object, preserving every original case while passing the intended steps array. All 11 workflow checks pass with the corrected fixture. The remaining type errors are still part of the active gate.
+
+Corrected the project tool tests to require actual executable handlers from the original factory, instead of assuming optional framework fields exist. Delegation tests now require a real converted input schema. The discovery test mock declares the record input it checks, and the Kody run fixture includes the required MCP content array without a cast. All 39 focused checks across those four files pass. Strict verification is rerunning against the full harness test project; remaining errors are not yet cleared.
+
+Preserved the original project's ordered tool tuple in tests rather than mapping it into a union of incompatible handlers. Each invocation now requires its own actual handler, keeping that tool's input signature. The Kody memory factory now declares its existing search/read ordering as a typed tuple without casts, and the stopped-message fixture carries the required tool-result state. All 30 focused project, memory, and message-history checks pass. Strict test type verification is rerunning; no full-gate success is claimed yet.
+
+### Project tool fixture contracts
+
+The carried-over project tool tests now supply the installed TanStack AI custom event callback and use the original workspace version constant. All 25 project tool tests pass, including ownership, cancellation, revision conflicts, receipt replay, and refresh only after commit. The dedicated harness TypeScript check still reports other incomplete test contracts, so this is not full verification of the port.
+
+### Table-driven contract verification
+
+Fixed array spreading in the original plugin disclosure and malformed retry request test tables. Each case now receives the intended complete tool list or message-part array. The workflow definition fixture goes through the original definition schema. Plugin and workflow checks pass all 8 cases, and retry restoration checks pass all 23 cases. These three test files have no remaining dedicated harness TypeScript errors. Broader port verification is still incomplete.
+
+### Browser execution protocol fixtures
+
+The original browser execution tests now provide explicit acknowledged event positions, complete unconfirmed shutdown errors, and spawn timeouts. Creation fixtures retain their exact command type and history maps accept string session IDs. All 159 tests across HTTP, owner lifecycle, and execution history pass. The dedicated harness type check reports 60 remaining errors after this batch, including obsolete SQL fixture types. These checks do not prove live browser execution or shared OAuth completion.
+
+### Usage and MCP callback verification
+
+Gateway assertions now use the native Headers API, and estimated Jev cost assertions narrow the actual billing status. All 13 usage tests pass. MCP transport authorization and stored-result routing mocks now use their actual callback contracts, with all 13 affected tests passing. Shared implementation behavior was not replaced. Remaining strict harness errors still prevent claiming the full verification gate is green.
+
+### Distinct delegation tool contracts
+
+The original delegation factory now retains each of its five tool schemas as a typed tuple, preventing unrelated argument contracts from intersecting when selecting a tool by position. Tool descriptions, runtime parsing, stable command identities, and access behavior stay the same. All 6 delegation and selected-source tests pass, including rejection of model-supplied authority fields. The provider credential tests also pass all 3 cases for key preservation, included access, and restricted providers.
+
+### Scheduling and selected-context fixtures
+
+All 58 scheduling, timezone schema, and selected-context tests pass with complete scheduled-run timestamps and explicitly typed malformed source identities. The original system-one research loop passes all 9 cases with candidates using its real source-action contract. These are carried-over behavior checks, not model efficacy tests.
+
+### Full carried-over harness verification after contract corrections
+
+The full harness suite passes 207 files and 2,061 tests after the contract corrections. Cloudflare storage fixture types are explicitly imported instead of depending on ambient globals. The conversation HTTP reader declares its two actual asynchronous methods, preserving unbuffered live stream responses and headers; the six reader and workspace boundary tests pass. The dedicated strict harness type check still reports 18 errors. This proves automated harness behavior coverage, not live authentication, browser runtime execution, production deployment, or full consolidation completion.
+
+### Kody inventory and generic MCP discovery contracts
+
+Kody metadata test callbacks now return unknown transport data, allowing the original inventory parser tests to cover incomplete and varied response shapes without tying every mock to the first fixture. All 13 inventory tests pass. Generic discovery and catalog mocks use their actual callback types, with all 41 affected tests passing. No task-specific routing was added.
+
+### Remaining strict test boundary cleanup
+
+Package detail tests now narrow unknown results before mutation, package access mocks use the real account state union, SQLite publisher inputs use native SQLInputValue, and mixed admission operations retain a void transaction callback. All 25 affected tests pass. Strict harness verification still has incomplete fixtures to resolve, including transcript copies, nested thinking, and middleware abort context.
+
+### Strict harness gate passes
+
+The dedicated harness TypeScript project now passes with no errors. The complete harness suite still passes 207 files and 2,061 tests after all fixture corrections. Transcript fixtures retain their exact source types, malformed nested reasoning remains explicitly rejected, memory operation identity is checked from actual object data, and middleware abort metadata matches the installed API. The combined application type gate was still running when this entry was recorded. Live authentication, browser runtime execution, deployment, and complete consolidation remain unverified.
+
+### Combined application types pass
+
+The complete test:tsc command passes: application types, builder evaluation scripts, native database verifiers, and dedicated harness test types. The full lint gate currently reports 36 errors and 100 warnings. Model reasoning, workspace session history, and workflow selectors now have explicit label/control associations using React useId and the existing SelectField API. Live authentication, rendered UI verification, production deployment, and full consolidation remain unfinished.
+
+### Unported conversation runtime fixture gap
+
+The original tests/fixtures/conversation-runtime.ts uses D1 migrations, D1 request bindings, and local SQLite Durable Object state. The pending retry-source runtime test has no matching fixture in the destination and is outside the passing core harness suite. It needs an actual PostgreSQL host fixture while retaining original local Durable Object state behavior, not a D1 compatibility shim or test exclusion. This is required evidence before claiming full conversation runtime parity. Sidebar selector labels also gained stable React control IDs.
+
+### Sidebar controls and copy decoder cleanup
+
+Parent conversation, sidebar section, and default display checkbox labels now point to actual shared UI control IDs. Focused lint no longer reports label association or decoder declaration errors in the affected files, though other sidebar lint failures remain. The copy protocol retains one immutable fatal UTF-8 decoder; all 32 retry evidence copy tests pass. The original conversation runtime fixture was inspected against the native PostgreSQL verifier setup, and its D1 setup still needs replacement before enabling the pending runtime tests.
+
+### Original conversation runtime fixture port started
+
+Added harness-tests/pending-runtime/fixtures/conversation-runtime.ts by porting the original Gum fixture. Its Durable Object state, reconstruction, transaction helper, and real Conversation calls remain from source. Account and conversation setup now uses native PostgreSQL, guarded to local databases named tanchat_test. The original D1 adapter and migrations are removed. This fixture has not run yet: pending runtime tests still need their direct D1 database mutations converted to PostgreSQL, and a migrated dedicated local test database must be prepared. It is not counted as passing runtime evidence.
+
+### Real conversation retry runtime verification passes
+
+The original retry-source runtime test file now uses native PostgreSQL queries and UUID account identity. Against the task-owned migrated local PostgreSQL database, all 10 tests pass through the actual Conversation object with original local SQLite Durable Object state and reconstruction. This covers settled inputs, archived evidence, revoked access during capture, deleted sources, successful file references, reset during capture, and late approval outcomes. The fixture reset uses TRUNCATE users CASCADE on a guarded local tanchat_test database. A separate failure was observed when deleting the fixture account: a sync trigger attempted to publish into chat_workspace_sync_clock after its referenced workspace was deleted. Account deletion needs a root-cause investigation. Other pending runtime test files and reproducible database setup still need verification.
+
+## Shared Google and GitHub popup completion
+
+Implemented following direct approval. Each popup attempt has a random completion channel bound to the verified OAuth state through the HttpOnly popup cookie. Completion uses BroadcastChannel with same-origin opener messaging as a fallback, and the login modal fetches the server session before closing. Existing provider, OAuth state, account and session checks remain in place. Cancellation and replacement attempts dispose their listeners, duplicate completion signals are ignored, and popup-blocked fallback still uses full-page login.
+
+Validation: seven focused tests passed, root and strict harness TypeScript checks passed, and eleven changed auth/test files passed type-aware lint with zero warnings or errors. Live provider login remains unverified because Chrome blocked http://localhost:3001/chat with ERR_BLOCKED_BY_CLIENT. No browser protection was bypassed. Not deployed.
+
+## Native PostgreSQL cascade lifecycle fix
+
+Migration 0038 replaces sync and membership lifecycle trigger functions. Cascading workspace deletion skips sync-clock updates after the workspace is gone, and cascading user/workspace deletion skips execution-generation inserts when either parent is gone. Normal membership revocation still advances its execution generation. No exceptions are swallowed.
+
+Verified harness-tests/postgres/cascade-lifecycle.sql against the dedicated local migrated PostgreSQL database with ON_ERROR_STOP: membership revocation, workspace deletion and account deletion all passed, and all test records rolled back. Migration has only been applied to the local test database, not production. Full consolidation and live login verification remain incomplete.
+
+## Expanded original conversation runtime verification
+
+Ported the original loaded-assistant-tools fixture and conversation-progress tests from Gum, preserving actual tool discovery, executors and authorization. Adapted identity to the native UUID fixture and repaired the test R2 object to expose its actual arrayBuffer contract. All three runtime files now pass, 17 tests, against dedicated local PostgreSQL. Coverage includes retry recovery, repeated validation failures, unchanged save/read/list loops, changed file content, receipts and persisted progress. Model responses and external storage are scripted test fixtures, this is not live provider or Cloudflare parity. Runtime fixtures still need strict typing and reproducible database setup before joining the default gate.
+
+## PostgreSQL runtime PR gate
+
+Added a separate PostgreSQL 17 service job to the existing PR workflow. It creates the explicit minimal existing-site boundary (users UUID key and showcase status), applies the complete production migration history using pnpm run db:migrate, runs the rolled-back cascade checks, then runs pnpm run test:chat-runtime. This baseline is only for isolated chat tests, it does not represent or verify the complete site authentication schema.
+
+Verified locally against fresh tanchat_test_ci_0930: complete migration history succeeded, cascade checks succeeded, three runtime files and all 17 tests passed. The GitHub job itself has not run and deployment remains outstanding.
+
+## Current release lint audit
+
+Full lint gate reported 20 errors and 100 warnings. Fixed three concrete failures: settings AI connection label now uses an associated control ID, browser execution setup timer uses a single const declaration, and the progress test digest uses an owned ArrayBuffer. Focused lint on those files has zero errors and two existing warnings. Actual browser execution bridge suite passes 25 tests. Remaining full-gate failures include autofocus patterns, keyboard/accessibility handling, Electron CommonJS preload rule mismatch and an unsafe test Function cast. No broad lint suppression added. Release gate remains incomplete.
+
+## Editing focus and preload gate fixes
+
+Queue and thread-title editors now focus via explicit edit-state transitions rather than DOM autofocus attributes. Inline rename keyboard events are isolated from the containing conversation row. Electron sandbox preload stays CommonJS, with a file-specific no-require-imports exception only for desktop/preload.cjs. Root TypeScript passed. Focused lint for the queue editor, thread editor and preload passed with zero warnings/errors. These focus interactions still need rendered browser validation, local Chrome access remains blocked. Other full release-gate failures remain unresolved.
+
+## Current Cloudflare bundle verification
+
+A fresh build caught the shared login context importing oauth-popup.client.ts into the server environment. Fixed the actual environment boundary with TanStack Start createClientOnlyFn, keeping import protection enabled. The complete pnpm run build:cloudflare command now exits successfully. Root TypeScript and seven focused popup tests also pass. Octane node-module externalization warnings remain and require live browser execution validation. Successful build is not a deployment or proof of production binding/auth parity.
+
+## Updated source and full harness audit
+
+Current full harness suite passes: 208 files, 2068 tests. Refreshed source coverage from the actual Gum and TanStack trees. All 107 core and 9 client files are present. 219 of 220 component paths are present, the removed SignIn component is replaced by shared TanStack login. Five old server paths are replaced by shared auth, native workspace identity, split API routes and shared host runtime. The coverage record now names those replacement paths explicitly. File presence does not prove behavior, and live auth/provider/Cloudflare checks remain incomplete.
+
+## Gateway proxy type and receiver verification
+
+Removed the production gateway run function cast and test binding/Function casts. The proxy now retains the concrete input binding type and invokes run with Reflect.apply and the native receiver. Strengthened the existing privacy test to assert original return identity and property forwarding alongside the payload logging header. Root TypeScript passes, focused lint has zero warnings/errors, and all 13 usage tests pass. No live provider request was made in this verification.
+
+## Sidebar editor focus contract
+
+Shared Modal now exposes the native Base UI Dialog.Popup initialFocus property. Conversation editing passes its name-input ref through that contract, retaining primitive-managed focus trapping and restoration. Section editing focuses only when the selected edit identity changes. Removed both sidebar autofocus attributes. Root TypeScript passed. Rendered keyboard/focus validation remains incomplete because local browser access is blocked.
+
+## Palette and schedule focus release fixes
+
+Refreshed full lint after prior fixes: ten errors remain, mostly autofocus plus scroll-region accessibility configuration. Command palette now uses its existing Base UI initialFocus contract on opening and an explicit page-depth transition to focus replacement inputs; removed redundant autofocus attributes. Schedule editor focuses the name field when its editor mounts. Root TypeScript and focused lint passed, and all 12 command-palette contract tests passed. Contract tests do not prove rendered focus, browser testing remains outstanding.
+
+## Integration form focus release fixes
+
+Connection setup name focus follows custom-form entry; disconnect and plugin-removal confirmations focus Cancel on their respective state transitions. Removed three DOM autofocus attributes while preserving safe default actions. Root TypeScript passes and focused lint reports zero errors, existing hook dependency warnings remain. Live keyboard focus verification is still outstanding.
+
+## Skill/reference focus and remaining lint gate
+
+Reference detail back buttons focus on detail-view entry, and skill editor name focus follows editable-field entry, including returning from preview. Removed the final three autofocus attributes. Root TypeScript passes. Full lint now reports 100 warnings and one error: the saved-file diff scroll region uses tabIndex for keyboard scrolling. An attempted roles allowlist did not affect the rule and was removed, no ineffective configuration retained and keyboard access remains intact. This last accessibility rule conflict remains a release blocker, along with live verification and deployment.
+
+## Complete project test gate passes
+
+Resolved the final lint error using the supported ARIA region allowlist in a correctly matching \*\*/SavedFiles.tsx override, retaining tabIndex and keyboard scrolling. The earlier literal path did not match this override. The complete pnpm test command exits zero: root/script/harness TypeScript checks, full lint (100 warnings, zero errors), 208 harness files with 2068 tests, 507 executed site unit tests with two skipped, and 17 desktop tests. This is the first current combined-gate result after shared popup, native runtime and focus fixes. PostgreSQL runtime CI job remains a separate check. Live provider/auth/browser execution, production deployment and feature-by-feature completion are still unverified.
+
+## Production secret preparation
+
+Read actual tanstack-com secret names using Wrangler 4.103.0. Shared DATABASE_URL, SESSION_SECRET and Google/GitHub OAuth credentials exist. ENCRYPTION_KEY was absent, which prevents chat bootstrap. Direct secret update was refused because the latest Worker version was not deployed. Used the supported versioned-secret command to prepare a new random encryption key without printing or retaining its value locally. Cloudflare confirmed version 0eed8adb-4c7d-4b81-a57b-f6fcdeb2d536 contains ENCRYPTION_KEY. This version is not deployed and traffic was not changed. The checkout remains a sibling task branch with shared uncommitted work, no Git state changed.
+
+## Production migration verification
+
+Compared the shared Neon migration ledger against the checked-out journal and SQL hashes. Production matched 0037_tanchat_kody_oauth exactly, with only 0038_tanchat_cascade_lifecycle pending. Applied the existing migration through Drizzle. The Builder verifier now confirms the exact 0038 hash, and the chat verifier confirms all 63 required tables and columns. This updates the database only, no Worker version or traffic changed. Live OAuth, provider execution, and the full consolidation remain unverified.
+
+## Cloudflare resource readiness audit
+
+Queried the explicit TanStack account 8da95258a9c70b54c3e2b374a0079106. All three configured R2 buckets exist: tanstack-github-content-cache, tanstack-npm-download-cache, and tanstack-notebook-projects. Saved files reuse the notebook bucket under saved-files/ keys. No Workflows are deployed in this account, so the configured TanChatWorkflow is still a deployment requirement. The included provider sends gateway metadata only when AI_GATEWAY_ID exists, and current configuration has no gateway ID. Native HTTP provider gateway routing also requires AI_GATEWAY_ACCOUNT_ID and AI_GATEWAY_TOKEN. Do not claim gateway cost visibility or workflow readiness from the build alone. No resources or traffic changed during this audit.
+
+## Original provider-attempt runtime tests ported
+
+Copied Gum conversation-provider-attempts.test.ts and adapted imports, native UUID identity, and two database assertions to PostgreSQL. Preserved its original assertions for retries, reconstruction, truncated tool transport, partial prose, absent versus zero usage, and verified discovery completion. The isolated local PostgreSQL runtime suite now passes four files and 26 tests. These use the real Conversation object and provider SDK with scripted transport, not live models. The existing PR runtime job includes the new file through its glob. Stopped the task-owned PostgreSQL server after verification.
+
+## Original durable run lifecycle tests ported
+
+Copied conversation-runs-runtime.test.ts from Gum, adapting native UUID identity and two PostgreSQL mutations while retaining its original lifecycle assertions. Fourteen tests verify queued admission and draining, cancellation, reset deduplication, history authorization, stopped runs, failed providers, and recovery after host loss. The combined suite exposed fixture contamination: chat_daily_usage has no account foreign key and survived TRUNCATE users CASCADE. The guarded local test reset now explicitly truncates chat_daily_usage too, preserving production allowance behavior. All five runtime files and 40 tests pass together. Task-owned PostgreSQL stopped after verification.
+
+## Original continuation runtime tests ported
+
+Copied Gum conversation-run-continuation.test.ts and conversation-schedule-continuation.test.ts, adapting imports and native UUID identity. Preserved six run continuation assertions and the scheduled setup continuation test. These verify durable run and scheduled occurrence identity when setup or approval resumes, using actual Conversation methods and the original controlled external-step boundary. All seven runtime files and 47 tests pass together on isolated PostgreSQL. This is not a live Cloudflare Workflow or external setup test. The task-owned database server is stopped.
+
+## Original schedule runtime and lifecycle tests ported
+
+Copied conversation-schedules-runtime.test.ts and conversation-schedule-lifecycle.test.ts from Gum, preserving their assertions and adapting account identity, policy updates, and archive/delete timestamps to PostgreSQL. Thirteen added tests cover alarms, policy loss, stale queued occurrences, archive/restore lifecycle suspension, and reconstruction. All nine runtime files and 60 tests pass together. The task-owned PostgreSQL server is stopped. This remains local runtime evidence, not deployed Cloudflare alarm or Workflow verification.
+
+## System-one runtime fidelity and remaining source inventory
+
+Copied the original conversation-runs-system-one.test.ts with import and native UUID identity adaptations. All ten runtime files and 69 tests pass together on isolated PostgreSQL, including nine original system-one run tests. External decision and MCP responses remain mocked, so this does not measure live Jev efficacy. Added tanchat-runtime-test-coverage.json from current source files and SHA-256 hashes: 27 original files use conversationHarness, ten are present and seventeen still need porting. Presence is explicitly separate from execution evidence. The task-owned database server is stopped.
+
+## Actual assistant discovery runtime verified
+
+Copied original assistant-discovery-runtime.test.ts, adapting imports, native UUID identity, and the shared PostgreSQL Skills constructor. This suite deliberately excludes loaded-assistant-tools and exercises actual discovery. Both original tests pass: initial authorized skill metadata excludes full instructions until read, and dynamically loaded tools survive approval/reconstruction but reset for a new task. All eleven runtime files and 71 tests pass together. The source inventory now records eleven present and sixteen missing runtime files. Scripted provider transport is still used, so this does not prove live model choices. Stopped the isolated database after verification.
+
+## Transcript paging runtime and deployment hold
+
+Copied the original transcript-navigation-runtime, context-reference-paging-runtime, and reference-cursor-contract tests, adapting imports, native account identity and PostgreSQL setup. All fourteen runtime files and 80 tests pass together. This verifies cursor/reset/reconstruction behavior and real context middleware paging, not browser latency. Updated the inventory, thirteen original runtime files remain missing. Stopped the isolated database server. Received explicit user deployment hold via sibling coordination: no deployment, remote publication, automatic-deploy merge, or cutover until approval after review. No deployment occurred in this turn. Existing local node process 26547 is listening on localhost port 3001, browser access still needs review.
+
+## Local review readiness check
+
+Confirmed Vite process 26547 remains alive on localhost port 3001. An in-app browser navigation to /chat is still refused with ERR_BLOCKED_BY_CLIENT. No browser protections changed. Checked environment presence only: local database, session secrets, Google/GitHub credential pairs, and encryption key exist. Included model is supplied by Wrangler vars, not .env.local. Added tanchat-local-review.md with exact local URL, start command, normal login path, unverified behaviors, and explicit deployment hold. No deployment or credential provisioning occurred.
+
+## Original integration memory review tests ported
+
+Copied conversation-kody-memory-review.test.ts with import and native account identity adaptations. Five original tests verify confirmed saves, uncertain write retry token retention, conflict handling, cancellation, and interrupted write review persistence. The remote Kody write remains mocked, no external writes occurred. All fifteen runtime files and 85 tests pass together. Twelve source runtime files remain missing in the refreshed inventory. Stopped the isolated PostgreSQL server. Deployment hold remains in force.
+
+## Dedicated runtime TypeScript audit started
+
+Added harness-tests/tsconfig.runtime.json to check the ported runtime suite independently. First run exposed missing SqlStorage imports, a missing declared AI binding in the fixture, outdated mocked system-one result fields, an invalid mocked MCP response, and union tool execute typing in reference-cursor-contract.test.ts. Corrected the straightforward fixture/interface mismatches. The reference tool typing and follow-up strict typecheck remain outstanding, so this configuration is not yet added to the required passing gate. No production or deployment changes.
+
+## Strict runtime TypeScript gate enabled
+
+A fresh non-incremental TypeScript check of harness-tests/tsconfig.runtime.json exits zero. Fixed source test interfaces by selecting named reference tools, declaring actual AI binding fixture methods, updating system-one results to events/calls, returning a valid MCP content array, and importing SqlStorage explicitly. Removed the provider environment cast. Added the dedicated runtime typecheck to test:tsc, which the existing pnpm test PR gate executes. Runtime rerun exits zero, exact counts in /private/tmp/tanchat-runtime-typed.log. Existing any casts in the original fixture still require cleanup, strict compilation does not imply their elimination. Stopped isolated PostgreSQL afterward. No deployment.
+
+## Original file copy runtime tests ported
+
+Copied conversation-file-copy.test.ts and adapted imports, account identity, and the storage fixture arrayBuffer/owned-byte contract. Both original exact-byte copy and interrupted publication cases pass. All sixteen runtime files and 87 tests pass together. Eleven source runtime files remain. Incremental TypeScript diagnostics again described old fixture source, so the dedicated runtime configuration now disables incremental checking, matching the verified fresh check. Fresh follow-up is still running, session 46537, log /private/tmp/tanchat-file-copy-types-fresh.log. Stopped local PostgreSQL. Deployment remains held.
+
+## Original native memory runtime tests ported
+
+Fresh file-copy TypeScript check passed. Copied memory-runtime.test.ts, adapting native Memories API, UUID identity, PostgreSQL queries and raw bigint assertions. All seventeen runtime files and 96 tests passed together before the final typed tool-selection cleanup. The strict check identified two ambiguous array-index selections, now replaced by named search_memory/save_memory selection. Follow-up strict check session 26314 is running, log /private/tmp/tanchat-memory-types-second.log, and these last test selections still need rerunning. Ten source runtime files remain. Stopped isolated PostgreSQL. Deployment remains held.
+
+## Original schedule approval tests ported
+
+Memory strict typing and final selected-tool rerun passed. Copied conversation-schedule-review.test.ts with native preferences API, UUID identity, PostgreSQL policy/membership/archive updates, and explicit SqlStorage import. All eighteen runtime files and 115 tests pass together, including nineteen original schedule review tests. Runtime TypeScript library configuration now includes ES2024 for original Promise.withResolvers usage supported by the test Node runtime. Follow-up strict check session 74336 is running, log /private/tmp/tanchat-schedule-review-types-second.log. Nine source runtime files remain. Stopped isolated PostgreSQL. No deployment.
+
+### Response preference runtime source port
+
+Ported the original Gum conversation-response-preferences tests with all nine cases retained. Account preference reads and writes use the native shared PostgreSQL service, and bot purpose is checked in chat_bots. The old D1 preference lookup failure injection now spies on the actual readAccountPreferences service boundary. Continued tasks assert that this service is never reread. The isolated local PostgreSQL runtime run passed all nine tests. Model transport remains scripted, this does not prove live provider or browser behavior. Runtime source inventory now contains 19 of 27 original harness test files, with eight still missing. Deployment remains held for user review.
+
+### Conversation discovery runtime source port
+
+Ported all seven original conversation-discovery-runtime tests. Fixtures now seed native PostgreSQL chat_bots, chat_conversations, chat_conversation_mains, chat_bot_sections and chat_bot_viewer_state. Assertions retain the original service behavior, using PostgreSQL boolean values for pinned state. Verified discovery, inspect and rename, pin, section lookup and rename, section removal, and one bulk call moving two conversations. The combined isolated database run passed 20 runtime files and 131 tests in 31.53 seconds, recorded in /private/tmp/tanchat-runtime-20-files.log. Strict runtime TypeScript checking also passed. Model responses remain scripted; this verifies actual harness tool execution and shared services, not model accuracy or live integrations. The source inventory now has 20 of 27 runtime test files present, with seven still missing. No deployment or publication occurred.
+
+### Plugin reference runtime source port and full gate findings
+
+All 12 original plugin-reference-runtime cases now pass against isolated PostgreSQL. The fixture uses the actual McpAccounts.ensureLegacy service to import saved connections before binding them. Revocation after context preparation is injected at the real awaited save boundary after a context observation is recorded, allowing the PostgreSQL update to finish before dispatch, without changing production timing or using a synchronous database adapter. Native policy updates, credential writes, plugin disable and account disable operations retain original assertions. Source inventory now contains 21 of 27 original runtime files.
+
+Full pnpm test runs exposed test infrastructure issues: the megabyte transport assertion was too expensive as generic array deep equality, so exact native Buffer byte equality now verifies unchanged payloads; the focused 41-case transport suite passes. Core worker concurrency is capped at four to avoid competing with the parallel project gates. The latest full gate stopped on type-aware lint errors in older runtime ports, not a passing full gate. Replaced ES2024-only schedule test helpers with ordinary promise gates and inaccurate reference environment casts with concrete getByName implementations. Those three modified suites pass 27 tests. Strict runtime typechecking is in progress, and the full gate must be rerun after fixes. Deployment remains held.
+
+### Validation orchestration and concrete fixture contracts
+
+The fifth full gate run completed site unit tests with 507 passed and two skipped, and type-aware lint with 101 warnings and zero errors. The core chat suite still timed out at the original five-second threshold in the 64-record evidence copy test, with 2067 other tests passing. This is not a green full gate. The complete pnpm test orchestration now runs gates sequentially using run-s, while the core suite uses four workers. This bounds competing resources and prevents one failing gate from interrupting other checks. A sequential full run is active, log /private/tmp/tanchat-current-full-gate-sequential.log. Concrete fixture contracts now include KODY_ORIGIN, fail-fast file methods for unexpected storage calls, valid included-model credentials and complete synthetic OAuth token fields. No broad environment casts were added to silence errors. Deployment remains held.
+
+### Workspace approval runtime source port
+
+Ported the original conversation-workspace-review suite with all 11 cases passing against isolated PostgreSQL. The Stop race uses a spy on the actual awaited readExecutionAuthority service, replacing the obsolete D1 statement wrapper. The suite retains durable approval persistence and rollback checks, no-command guarantees after Stop, and real stream patch base verification after alarm rollback and retry. Original source test file inventory now contains 22 of 27 files. Log: /private/tmp/tanchat-workspace-review-runtime.log. Full sequential project gate is still running at the typecheck stage, so this new port also requires strict type verification after the current run. No deployment.
+
+### Complete sequential project gate passed
+
+The sequential pnpm test run exited zero. All root, script, core harness and runtime harness TypeScript checks passed. Type-aware lint reported 101 warnings and zero errors. Site tests passed 508 with two skipped. All 208 chat core files passed, 2068 tests total, including the 64-record retry evidence copy case that timed out under the parallel project gates. Desktop passed all 17 tests. Authoritative log: /private/tmp/tanchat-current-full-gate-sequential.log. The latest workspace review port was present before the runtime typecheck stage, and is covered by this strict gate.
+
+Restarted the local review server only after confirming no process listened on port 3001. Vite reports ready at http://localhost:3001/chat; process session 61365 remains live. Browser navigation to the actual consolidated app and subsequent tab inspection timed out in CDP, so rendered UI and real OAuth remain unverified. A cancelled stream was logged after browser navigation timeout. No deployment or production publication occurred.
+
+### Valid-token plugin fixture isolation
+
+Combined runtime validation exposed a fixture coupling after synthetic OAuth tokens were made structurally valid: the unified SkillCatalog started refreshing the unrelated Kody skill directory through a real MCP handshake. No request was transmitted because the fixture fetch guard threw. The selected-plugin approval case now stubs only Kody skill listing, suggestions and guidance, while keeping real shared plugin authorization, durable approvals, restart and revocation checks. All 12 plugin tests pass with the original no-network assertion preserved. Log: /private/tmp/tanchat-plugin-reference-verified.log. A new combined 22-file run is active at /private/tmp/tanchat-runtime-22-files-verified.log, no combined pass is claimed yet. Temporary diagnostic tracing was removed.
+
+The combined 22-file runtime check exited zero. All 154 tests passed, including native plugin approval and workspace authority races. Log: /private/tmp/tanchat-runtime-22-files-verified.log. The isolated PostgreSQL test server was stopped after completion. This remains scripted-model runtime evidence, not proof of live OAuth, deployed Cloudflare behavior or real model accuracy.
+
+### Current Cloudflare bundle verified locally
+
+The current pnpm build:cloudflare run exited zero, log /private/tmp/tanchat-cloudflare-build-current.log. Worker configuration binds STREAMS, WORKSPACE_SYNC and CONVERSATIONS to source-exported classes and configures TanChatWorkflow under WORKFLOW_RUNS. This verifies the local bundle, not remote binding creation.
+
+Build warnings originate from octane/compiler re-exporting Vite and bundler modules that use Node builtins. Inspected the emitted compiler-BiV0P-EY.js client chunk: it exports compile and contains none of node:fs, node:path, createRequire, readFileSync or octane/compiler/vite. The build strips those unused compiler exports, so no source change or private deep import was introduced. Browser execution of that compiler remains unverified. Deployment remains held.
+
+## Motion, touch, and desktop fidelity check
+
+Compared the source directly after the report of missing motion. The mobile drawer, long press, mobile back, mobile viewport, panel motion, resizable sidebar, and UI motion helper files are byte-identical to Gum. Motion element and AnimatePresence counts match in ConversationView, BotWorkspace, ConversationWorkspace, ConversationSession, ConversationTurn, and Modal. Chat route imports the scoped stylesheet containing the original motion rules. This proves source presence and selected wiring, not rendered behavior.
+
+Ported the original mobile gesture tests with import path changes only, all six pass. All 17 Electron tests pass, including native bridge isolation, connected folders, update lifecycle, and consolidated chat launch. Electron code is retained, no shipping or deployment performed.
+
+Browser security policy rejected local page inspection. The reported live motion regression remains unverified and unresolved, source parity must not be treated as UI fidelity proof. A full rendered interaction audit remains required.
+
+Additional original interface coverage is now ported: mobile viewport and composer focus handoff, ten tests pass. Viewport tests cover software keyboard resize, Safari pan, event coalescing, pinch zoom, desktop release, and cleanup. Focus tests preserve first-send focus without stealing focus after another user action. MobileRuntime mounts the real viewport observer from ChatShell. These are simulated DOM checks, not real-device gesture verification.
+
+### Additional fidelity gates
+
+Ported original workspace panel, transcript minimap, and conversation thread UI tests with import path changes only. All 31 pass, including hidden panel state preservation, stable resource identity, panel authorization failures, thread request retry identity, and long transcript navigation. Current core test TypeScript gate passes after annotating the original focus fixture return type and updating the popup test import to the current shared module name.
+
+Three real PostgreSQL bulk section race tests now pass. Awaitable pre-commit callbacks allow the tests to revoke membership, delete the destination, or change the selected section before mutation. The mutation rechecks state and rejects without overwriting it. Revoked membership uses the shared backend privacy-preserving 404, changed destination or selection uses 409. This is separate coverage, the full original assistant-conversation-tools test file remains unported.
+
+The combined current ported runtime suite passes: 23 files, 157 tests, 32.63 seconds. Evidence: /private/tmp/tanchat-runtime-current-fidelity.log. This uses real PostgreSQL and Conversation code with scripted external transports, it does not prove live provider accuracy, browser fidelity, or deployed Cloudflare behavior. The isolated test database was stopped after the process completed.
+
+Current interface fidelity batch: seven files, 54 tests pass. Full type-aware lint: 103 warnings, zero errors. The race fixture now explicitly rejects unexpected conversation lifecycle calls rather than relying on a partially typed namespace. The mobile hook test fixture is named as a component to retain the Rules of Hooks check.
+
+## Installable chat and offline fidelity
+
+Found and fixed a consolidation gap: the chat install prompt inherited the TanStack homepage manifest. Added /chat/manifest.webmanifest with TanChat identity and /chat entry/scope, reusing the existing TanStack PNG icons. The shared root chooses exactly one manifest based on matched chat paths, leaving other TanStack routes on the site manifest.
+
+Moved the chat worker to /tanchat-sw.js so its /chat registration scope includes the exact entry route without a Service-Worker-Allowed override. Fetch interception is limited to the exact /chat path or /chat/ descendants. The worker only caches the public offline page, never authenticated HTML, APIs, mutations, or external requests. Twelve ported/expanded offline tests pass, including PNG dimensions, exact entry, nested navigation, auth/API/site isolation and subresource isolation. Actual browser installation remains unverified. No deployment performed.
+
+All five current TypeScript gates pass after the install/offline changes: root application, builder evaluation scripts, shared scripts, core harness tests, and conversation runtime tests. Full lint reports 103 warnings and zero errors. Evidence: /private/tmp/tanchat-pwa-all-types.log and /private/tmp/tanchat-pwa-lint-final.log.
+
+## Draft, attachment, reference, and execution fidelity
+
+Ported original composer attachment, message attachment, composer reference, and response copy tests. Updated stale fixture shapes to include current draft synchronization and sketch/input props, removed unused controller-only props from the view fixture, and replaced the old untyped Env cast with a concrete file binding that rejects unexpected file I/O. Assertions remain unchanged. These four files pass 58 tests.
+
+Together with existing original draft reconciliation, draft HTTP boundary, browser execution owner, and execution HTTP ports, the batch passes 205 tests across eight files. Coverage includes attachment byte fingerprints on retry, trusted scoped metadata, reference source labels, draft conflict preservation, account isolation, and exact local execution/preview ownership. Evidence: /private/tmp/tanchat-composer-execution-fidelity.log. Type-aware lint passes with 105 warnings and zero errors. These checks do not prove real browser model execution or file delivery.
+
+## Workflow host runtime port
+
+Ported the complete original workflow-runtime.test.ts against the native PostgreSQL conversation fixture. Adaptations are UUID account identity, native chat_conversations/chat_memberships statements, imported Cloudflare storage type, and destination import paths. All three original cases pass: idle host authority and reservation persistence through reconstruction, cancelled authority without receipt loss, and exact child identity/membership rechecks. Runtime TypeScript gate passes. Original runtime inventory now has 23 of 27 source files present, four remain unported. The separate three-case bulk section race file is additional coverage and does not stand in for the original assistant-conversation-tools suite.
+
+Combined conversation runtime verification including the new workflow port passes: 24 files, 160 tests, 44.48 seconds (/private/tmp/tanchat-runtime-with-workflows.log). Workflow core/service boundary batch passes 52 tests across ten files (/private/tmp/tanchat-workflow-core-current.log). Full lint passes with 105 warnings, zero errors. Isolated PostgreSQL stopped after verification. Live cloud workflow execution and rendered task completion remain unverified, deployment is held.
+
+## Conversation management runtime port
+
+Ported all 29 original assistant-conversation-tools tests against real PostgreSQL. Seeds and reads use native shared tables and UUID users, booleans stay booleans, and deleted_at uses a PostgreSQL timestamp. The SQLite trigger failure is replaced with a native PostgreSQL trigger and function, removed in finally. The exact synthetic error is asserted through Drizzle cause, and all rows must remain unchanged after failure. No D1 compatibility database was introduced.
+
+Original post-batch concurrent writes now run at the actual awaited workspace publish boundary after the transaction and before verification reads. Assertions retain observed revision/name and exactly one write. Async pre-commit changes retain cancellation, membership, selection and destination checks, with shared privacy-preserving 404 for revoked membership. All 29 pass. Added explicit Promise to readBotSections so section discovery has an explicit service contract in the type-aware lint gate. Lint passes with 105 warnings and zero errors. Original runtime inventory now has 24 of 27 files present, three remain unported. Source presence remains separate from execution evidence.
+
+Combined runtime suite with full conversation management passes: 25 files, 189 tests, 38.17 seconds. Evidence: /private/tmp/tanchat-runtime-with-conversation-management.log. Runtime TypeScript gate passes after the section return annotation. The isolated PostgreSQL process was stopped after test completion. No deployment or live browser verification is implied.
+
+## Shared session execution and snapshot fidelity
+
+Ported all ten original execution HTTP cases and all seventeen original project snapshot HTTP cases through the real shared AuthService, SessionService, user and capability repositories, PostgreSQL conversation ownership, and Conversation host. Added four cases for tampered cookies, expired sessions, revoked session versions, and removed capabilities. All 31 cases pass across two files (/private/tmp/tanchat-execution-snapshots-verified.log).
+
+The isolated database fixture adds auth columns using the actual Drizzle column types. It does not reproduce all shared schema constraints or prove production migrations. Test sessions are signed through the real session service, no fabricated authenticated user is injected. Cloudflare runtime bindings and R2 transport remain controlled fixtures. Snapshot checks retain exact binary bytes, checksum verification, immutable publication, retry recovery, revocation races, and restore authorization. Shared privacy checks return 404 after revoked conversation access.
+
+Original runtime source coverage now includes 26 of 27 files. retry-attempt-runtime.test.ts remains unported. This inventory is not a claim of rendered UI parity or live service verification.
+
+Combined runtime verification passes 220 tests across 27 files in 40.23 seconds (/private/tmp/tanchat-runtime-native-http-combined.log). This includes extra native race coverage, 26 of the 27 original source files are present. Runtime TypeScript passes and full lint reports 106 warnings, zero errors. Isolated PostgreSQL stopped after verification.
+
+## Retry attempt runtime port
+
+Ported the complete original retry-attempt-runtime.test.ts. Native Drizzle reads use shared retry and copy tables, account IDs are UUIDs, and membership mutations use PostgreSQL. Race hooks run after the real getAuthorizedCopyOperation and readConversationLifecycle boundaries, preserving final authorization races without a D1 compatibility layer. All 25 original cases pass, including immutable review records, inert inherited action evidence, private reasoning exclusion, branch preparation, reset recovery, queued retries, duplicate submission identity, validation races, and inherited inventory changes through repeated forks and copies.
+
+Evidence: /private/tmp/tanchat-retry-attempt-native-current.log. Runtime TypeScript passes and full lint reports 106 warnings, zero errors. Original private Conversation state inspection and fixture casts are retained from the source tests, this is not a claim that all fixture casts have been removed. The runtime inventory now contains all 27 original source files. Live browser motion, production model/MCP tasks, deployed workflows, and release verification remain incomplete. Deployment stays held.
+
+The combined runtime suite passes 245 tests across 28 files in 43.17 seconds (/private/tmp/tanchat-runtime-all-original-files.log). The extra file is native bulk race coverage, the original inventory is 27 of 27. The existing PR workflow already runs test:chat-runtime against PostgreSQL 17 after the disposable baseline, migrations, and cascade checks. Its remote job has not run for this worktree. Isolated local PostgreSQL stopped after verification.
+
+## Full gate and emitted asset check after fidelity ports
+
+The sequential full test command passed all five TypeScript gates, lint (106 warnings, zero errors), and site unit checks (508 pass, two skipped). Its first harness run found a stale chat-offline-worker test referencing the removed public/chat/sw.js path and excluding /chat. Updated that test to the actual root worker and to assert both exact /chat and nested navigation, preserving auth/API/site exclusion checks. The corrected full harness batch passes 2,185 tests across 219 files. Electron passes all 17 tests. A follow-up core test TypeScript check and lint also pass.
+
+Evidence: /private/tmp/tanchat-full-gate-after-runtime-fidelity.log (initial offline fixture failure retained), /private/tmp/tanchat-chat-full-current.log, /private/tmp/tanchat-desktop-current.log, /private/tmp/tanchat-offline-test-types.log, /private/tmp/tanchat-final-fidelity-lint.log. These constituent checks pass, the original sequential command was not rerun after the one test fixture correction.
+
+The current Cloudflare build succeeds (/private/tmp/tanchat-cloudflare-build-after-fidelity.log). Inspecting emitted client assets confirms scoped chat motion token definitions, reduced-motion rules, sidebar width transitions, the root service worker, chat manifest, offline page, and every referenced manifest icon. Build output includes existing Octane browser externalization warnings, this does not prove browser compilation works. Emitted CSS presence does not resolve the reported live animation regression. No deployment, publication, or production activation occurred.
+
+## Chat document isolation and entry navigation
+
+The source audit found a native integration gap: private chat documents did not send the isolation headers required by the reused local SDK and WebContainer runtime. Added the existing webContainerHeaders to the /chat layout, preserving private no-store headers. Shared Google/GitHub login validation is unchanged, the previously approved per-attempt popup completion channel remains in place.
+
+Document isolation cannot change during SPA navigation. Site account/menu links and standalone project return links now use reloadDocument when entering chat. All legacy Builder redirects do the same while preserving project IDs, public hashes, template selection, and chart/project hash destinations. Chat-internal navigation is unchanged. No automatic refresh loop or isolation bypass was added.
+
+Four focused files pass eleven checks for actual route header callbacks, all seven legacy redirect destinations, and shared/integration popup completion (/private/tmp/tanchat-isolation-entry-verified.log). Application and core test TypeScript gates pass; lint reports 106 warnings, zero errors. The current Cloudflare build passes (/private/tmp/tanchat-isolation-cloudflare-build.log), and its shared router asset retains the chat header callback. These are source and build checks, actual crossOriginIsolated, SDK startup, and Google/GitHub popup completion remain unverified in a real browser. Deployment remains held.
+
+Corrected the desktop provenance inventory to reference desktop/builder.config.mjs, the actual ES module packaging configuration. All 22 desktop inventory destinations exist. Historical Kody assets remain inactive package inputs, the active icon uses the existing TanStack logo.
+
+## Canonical chat origin and gateway environment
+
+The chat.tanstack.com alias handler now redirects safe navigation to tanstack.com/chat before shared auth or database work. It keeps only validated chat navigation options, strips OAuth and unknown parameters, prevents fragment inheritance, and rejects non-navigation methods. Signed-in /chat entry now carries validated options into the assistant. Existing signed-out login checks remain unchanged. DNS and deployment are still held, the live alias is not verified.
+
+Conversation runtime environment now inherits ProviderEnv directly, including optional Cloudflare gateway settings. This is a type contract correction, not gateway provisioning or evidence of live cost reporting. Nineteen focused redirect and entry checks passed before the route input typing adjustment. Final checks are recorded in /private/tmp/tanchat-entry-final-types.log, /private/tmp/tanchat-entry-final-test-types.log, /private/tmp/tanchat-entry-final-tests.log and /private/tmp/tanchat-entry-final-lint.log. Browser motion and touch behavior remain unverified, the browser inspection tool rejected local URL access and no alternate access path was used.
+
+## Follow-up motion wiring audit
+
+Rechecked the current destination rather than relying on the inventory. useMobileDrawer, useLongPress, mobile-back, and ui/motion are byte-identical to the source. App invokes useMobileDrawer with the live sidebar ref and drawer state. BotWorkspace retains MotionConfig, AnimatePresence, and motion layout nodes. The chat layout registers its scoped stylesheet through its route head. The shared theme provider removes its transition suppression class after two animation frames, it is not a permanent motion disable switch. These checks do not identify the reported rendered regression.
+
+The current local Cloudflare build passes after the entry search change (/private/tmp/tanchat-current-audit-build.log). Application and harness TypeScript checks pass, the nineteen entry and alias tests pass, and lint reports 106 warnings with zero errors. No release or deployment took place. Browser and device verification remain required.
+
+## Desktop release tooling and clean-checkout portability
+
+Found and ported two missing original scripts, desktop-release.mjs and desktop-publish.mjs. Release verification retains signature identity, notarization, Gatekeeper, blockmap, artifact hash, and feed validation. Publishing retains immutable artifact checks and advertises the feed only after download verification. TanStack commands now expose verification, finalization, and publication separately. Publishing requires explicit TANSTACK_UPDATE_URL and TANSTACK_RELEASE_BUCKET, uses the configured update path for R2 object prefixes, and no longer targets the personal download host or Kody release bucket. Both scripts pass node --check. No notarization, upload, or publication was run.
+
+The shared package.json, pnpm workspace override, and lockfile still reference browser-sandbox packages under a machine-local temporary directory. Those are pre-existing sibling-owned changes, preserved here. A passing build on this machine does not prove clean checkout installation or CI portability. This remains a release blocker alongside real browser verification and the explicit deployment hold.
+
+## Operational script inventory and copy benchmarks
+
+Added docs/tanchat-script-port-inventory.json listing every original script and its current destination, or an explicit unresolved disposition. Historical research, live evaluations, diagnostics, and smoke scripts are not covered by the runtime test inventory. Their missing paths must not be interpreted as a complete operational port.
+
+Ported the actual original local SQLite copy and protocol benchmarks under scripts/chat, changing imports to the destination chat code. The source benchmark fixture casts remain unchanged. Both commands pass. At 50,000 turns the indexed lookup completes 100 lookups in 0.143 ms, compared with 598.751 ms for the old query. At 10,000 turns an early fork through the first three turns takes 5.51 ms and transfers 2,673 bytes. A full duplicate of 20,000 messages takes 2,717.85 ms locally, with 10,000 pages and 626 export/import bursts. These are synthetic local measurements, not network, Durable Object alarm, browser, or provider performance. Evidence is /private/tmp/tanchat-copy-benchmark-current.log and /private/tmp/tanchat-protocol-benchmark-current.log. The protocol result highlights why live long-copy verification still matters.
+
+## First desktop release support
+
+The source publisher assumed an existing latest-mac.yml feed, which cannot hold for a fresh TanStack update location. The port now accepts only an HTTP 404 as an absent feed, validates the first version, and preserves strict increasing-version checks for existing feeds. Other HTTP failures and malformed existing feeds still fail. Immutable artifact, checksum, signing, and feed-publication ordering checks remain in place. Three local version regression cases pass in desktop/release-version.test.mjs. This does not verify actual storage hosting or publication, neither was performed.
+
+## Pre-bootstrap theme restoration
+
+Found a shared-site appearance leak: the chat startup script changed document palette variables before AppearanceSync captured its restoration snapshot. Added a pre-palette snapshot in the actual startup script and consume it once during layout setup, retaining the existing snapshot path for later client-only mounts. Cleanup restores the pre-chat variables, appearance attributes, and theme-color metadata. This fixes capture order without changing theme preferences or auth. The actual startup script regression check passes and application TypeScript passes. Real browser route exit and rendered motion remain unverified.
+
+The follow-up appearance test invokes the actual AppearanceSync layout cleanup, verifies restoration of palette values, missing-property removal, appearance attributes and theme-color metadata, and verifies the startup snapshot is consumed once. Both startup and cleanup regression cases pass (/private/tmp/tanchat-appearance-cleanup-tests.log). Full project verification is running under /private/tmp/tanchat-consolidation-current-full-gate.log, its result remains pending until the command exits.
+
+## Current combined local gate
+
+The complete pnpm test command exited zero after the appearance, entry-navigation, release-version, and benchmark type fixes. All five TypeScript gates pass, lint has 106 warnings and zero errors, site tests pass 508 with two skipped, harness tests pass 2,208 across 224 files, and Electron tests pass 20. Evidence: /private/tmp/tanchat-consolidation-current-full-gate.log. This replaces earlier pending or constituent-only gate results. PostgreSQL runtime verification remains separate, the last verified batch is 245 tests. No deployment or publication occurred.
+
+## Live execution integration gap found during sibling recheck
+
+Read current sibling work and inspected actual source. The shared site browser-sandbox dependency manifest reports API version 6. Chat executionArtifact still identifies the preserved API version 5 candidate and its old hashes. Chat ExecutionOwnersProvider actually opens execution-browser-bridge.ts, rather than the shared example SDK session. That bridge explicitly rejects production and any origin other than http://127.0.0.1:3002, then loads the broker at http://127.0.0.1:4320/gum-broker.html. The installed shared SDK directory has no gum-broker.html at its root. This does not prove a separately hosted broker is absent, but there is no evidence that the native TanStack chat execution path is operational.
+
+The sibling browser-runtime work remains active and its recent evidence includes a plain-HTML build-loading failure. No compatible release or portable package was established by this check. Do not relabel old artifact hashes as the newer SDK, relax the bridge boundary to make a test pass, or infer chat execution readiness from shared example builds. The actual bridge/runtime adaptation and real execution remain explicit consolidation requirements. Existing source safeguards and sibling-owned dependencies were preserved.
+
+Inspected the installed API 6 HostedKernel declarations. It already supplies isolated-host file access, run/spawn, process cleanup, snapshots, preview inspection/click and close. Recorded the concrete operation mapping and preserved ownership requirements in docs/tanchat-execution-adaptation.md. This establishes a reuse path without writing another sandbox, but does not implement or verify the replacement bridge.
+
+## Execution host boundary revalidation
+
+The existing scripts/local-browser-sandbox.ts plugin is serve-only and explicitly a local consumer experiment. It requires a tested manifest hash and isolated fixture inputs; the currently linked SDK directory has no manifest.json. It is not a production isolated-host deployment. The shared example SDK uses WorkerKernel directly, while chat still uses the older broker. No existing ready host URL or verified compatible artifact was established. This runtime/host dependency has persisted through three consecutive goal turns. Together with rejected live browser access and the explicit deployment hold, it prevents completing and verifying the requested end state. No dependency override, origin relaxation, fake artifact identity, alternate browser access, or deployment workaround was introduced.
+
+## User-reported layout and polish regression
+
+The user reports missing or partial animations, gestures and reveals in the actual TanStack app. Existing static parity and fixture gates do not rebut that observation. Found the conversation header rendered outside ConversationWorkspace, making it span the chat and right panel. Moved it into the workspace conversation children so the right panel sits alongside the full chat column. The broader motion regression remains unresolved and must be investigated from rendered evidence, not marked verified by retained handlers.
diff --git a/docs/tanchat-core-port.json b/docs/tanchat-core-port.json
new file mode 100644
index 000000000..418048cc8
--- /dev/null
+++ b/docs/tanchat-core-port.json
@@ -0,0 +1,754 @@
+[
+ {
+ "source": "src/core/account-preferences.ts",
+ "destination": "src/chat/core/account-preferences.ts",
+ "sourceSha256": "b9253f3b30b6a59e395c4a42d0d9675875aa94b021cf336fb561ea8fb9fc2c70",
+ "destinationSha256": "b9253f3b30b6a59e395c4a42d0d9675875aa94b021cf336fb561ea8fb9fc2c70",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/action-evidence-view.ts",
+ "destination": "src/chat/core/action-evidence-view.ts",
+ "sourceSha256": "59bdb8d438c9aa40da392c074235ce71c737a25af08021cf98ceb0ec5de28147",
+ "destinationSha256": "59bdb8d438c9aa40da392c074235ce71c737a25af08021cf98ceb0ec5de28147",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/answers.ts",
+ "destination": "src/chat/core/answers.ts",
+ "sourceSha256": "55da636098c08e447fa9e5b6c05509fec161a851da6f1d8e1a626b80616696cd",
+ "destinationSha256": "55da636098c08e447fa9e5b6c05509fec161a851da6f1d8e1a626b80616696cd",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/app-version.ts",
+ "destination": "src/chat/core/app-version.ts",
+ "sourceSha256": "42821ce1d26ed68b4f027d3de9639f8c77e09883ec9d77db51772eb41fea093f",
+ "destinationSha256": "42821ce1d26ed68b4f027d3de9639f8c77e09883ec9d77db51772eb41fea093f",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/appearance-bootstrap.ts",
+ "destination": "src/chat/core/appearance-bootstrap.ts",
+ "sourceSha256": "cb006b4f2bc0f0fa5194e73dc06057e04d17aa23857c182315a233f68c434b75",
+ "destinationSha256": "cb006b4f2bc0f0fa5194e73dc06057e04d17aa23857c182315a233f68c434b75",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/appearance.ts",
+ "destination": "src/chat/core/appearance.ts",
+ "sourceSha256": "6befded9139a7784a155f33088d7557fa19d239a5936d94570498193f71222ac",
+ "destinationSha256": "6befded9139a7784a155f33088d7557fa19d239a5936d94570498193f71222ac",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/assistant-progress.ts",
+ "destination": "src/chat/core/assistant-progress.ts",
+ "sourceSha256": "23f875484b2f0271203018424ddb9f4b35578639e313ba38a013449c63d6dda0",
+ "destinationSha256": "23f875484b2f0271203018424ddb9f4b35578639e313ba38a013449c63d6dda0",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/assistant-task.ts",
+ "destination": "src/chat/core/assistant-task.ts",
+ "sourceSha256": "a9d31286f9a2db76cf1f1fa0169b51ebad705b88ec9cf882ab4cbb536556cddf",
+ "destinationSha256": "a9d31286f9a2db76cf1f1fa0169b51ebad705b88ec9cf882ab4cbb536556cddf",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/avatar.ts",
+ "destination": "src/chat/core/avatar.ts",
+ "sourceSha256": "30d1b24d9aebb169a27a15879d8726d20a0448bb8b06ccf25d01b78a5e732fe4",
+ "destinationSha256": "30d1b24d9aebb169a27a15879d8726d20a0448bb8b06ccf25d01b78a5e732fe4",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/bot-activity.ts",
+ "destination": "src/chat/core/bot-activity.ts",
+ "sourceSha256": "15f843384bb0f2c38736e54b428d96e84fc67f1c9c4a2a8c40dd40f0b8da77b8",
+ "destinationSha256": "15f843384bb0f2c38736e54b428d96e84fc67f1c9c4a2a8c40dd40f0b8da77b8",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/bot-draft.ts",
+ "destination": "src/chat/core/bot-draft.ts",
+ "sourceSha256": "bb83db9802fc9585d39e101d0ead99edf433933f6dea60fa421271372a917aff",
+ "destinationSha256": "bb83db9802fc9585d39e101d0ead99edf433933f6dea60fa421271372a917aff",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/bot-drag.ts",
+ "destination": "src/chat/core/bot-drag.ts",
+ "sourceSha256": "3f00e577ec71fe300d94c1dc01aa37434c20d40e755d332cdf8702f40916cabf",
+ "destinationSha256": "3f00e577ec71fe300d94c1dc01aa37434c20d40e755d332cdf8702f40916cabf",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/bot-group-move.ts",
+ "destination": "src/chat/core/bot-group-move.ts",
+ "sourceSha256": "049d919b1ab9b4c665e98e5620fa019302910680ac5c030c10354a230672af89",
+ "destinationSha256": "049d919b1ab9b4c665e98e5620fa019302910680ac5c030c10354a230672af89",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/bot-views.ts",
+ "destination": "src/chat/core/bot-views.ts",
+ "sourceSha256": "5ff298ab26d030b36722904d6d0088cb8b51f377e298aa92dd40eae976b689f4",
+ "destinationSha256": "5ff298ab26d030b36722904d6d0088cb8b51f377e298aa92dd40eae976b689f4",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/bot-workspace.ts",
+ "destination": "src/chat/core/bot-workspace.ts",
+ "sourceSha256": "5bffae27b87307b0ce40d238dd915611df65aa336d9870f58c950e54c2542366",
+ "destinationSha256": "566467be9a4a0fc68b49ff14dbb10002396a364c354668ebe12baeaec1047505",
+ "unchanged": false
+ },
+ {
+ "source": "src/core/command-palette.ts",
+ "destination": "src/chat/core/command-palette.ts",
+ "sourceSha256": "5587b397f67379199d769cc879ee71bd1750aecb2083f33ead011cc205ed1329",
+ "destinationSha256": "5587b397f67379199d769cc879ee71bd1750aecb2083f33ead011cc205ed1329",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/context-observation.ts",
+ "destination": "src/chat/core/context-observation.ts",
+ "sourceSha256": "73b9c0ab86815aa32e89cf4a0ef012ac44b70760cc3e2d7dada094ace9cd4f56",
+ "destinationSha256": "73b9c0ab86815aa32e89cf4a0ef012ac44b70760cc3e2d7dada094ace9cd4f56",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/conversation-actions.ts",
+ "destination": "src/chat/core/conversation-actions.ts",
+ "sourceSha256": "ac4975008cf93d5ea3adf34f32e9f1ff3e5d7964ad1570288ac15fb58c8f0e07",
+ "destinationSha256": "ac4975008cf93d5ea3adf34f32e9f1ff3e5d7964ad1570288ac15fb58c8f0e07",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/conversation-bulk-actions.ts",
+ "destination": "src/chat/core/conversation-bulk-actions.ts",
+ "sourceSha256": "4a4ee0f1495c67428700d8907f23bae84ff89e983e8fb4aedab7928a5f82d2c5",
+ "destinationSha256": "4a4ee0f1495c67428700d8907f23bae84ff89e983e8fb4aedab7928a5f82d2c5",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/conversation-copy.ts",
+ "destination": "src/chat/core/conversation-copy.ts",
+ "sourceSha256": "fac47893d6bfd6ed5dfbc3b4883ddb65eecd4a0c6eda49fd9070b4a985f612e5",
+ "destinationSha256": "fac47893d6bfd6ed5dfbc3b4883ddb65eecd4a0c6eda49fd9070b4a985f612e5",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/conversation-destination.ts",
+ "destination": "src/chat/core/conversation-destination.ts",
+ "sourceSha256": "d08cb2cc2482fed92320b60c08cf435ecfe8b928dc8637988ce511bcd0845966",
+ "destinationSha256": "fee506c86f3ac11a2f86e441290e729f777ac39ac759b344eb4c7583c38d7180",
+ "unchanged": false,
+ "adaptation": "Workspace URL namespace moved from /w to /chat/w"
+ },
+ {
+ "source": "src/core/conversation-family.ts",
+ "destination": "src/chat/core/conversation-family.ts",
+ "sourceSha256": "b8705818b0f25fcb2136b14a5349c52e0f35f7f912b36e61027ec342a778463d",
+ "destinationSha256": "b8705818b0f25fcb2136b14a5349c52e0f35f7f912b36e61027ec342a778463d",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/conversation-queue.ts",
+ "destination": "src/chat/core/conversation-queue.ts",
+ "sourceSha256": "6f2a943826f58e2be62b4b0090a3d3adc86eddf3a13e5301dcedcf76c4282521",
+ "destinationSha256": "6f2a943826f58e2be62b4b0090a3d3adc86eddf3a13e5301dcedcf76c4282521",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/conversation-reference-cursor.ts",
+ "destination": "src/chat/core/conversation-reference-cursor.ts",
+ "sourceSha256": "92ece39fc1876e2a102290a26ec17a7faa85a6f72a54e5ca3d4a5c48f5791054",
+ "destinationSha256": "92ece39fc1876e2a102290a26ec17a7faa85a6f72a54e5ca3d4a5c48f5791054",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/conversation-retry.ts",
+ "destination": "src/chat/core/conversation-retry.ts",
+ "sourceSha256": "55a0717f9c9469b85d7aac3758e413f21019735b439a4c42a05bc0b98f6866ca",
+ "destinationSha256": "55a0717f9c9469b85d7aac3758e413f21019735b439a4c42a05bc0b98f6866ca",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/conversation-runs.ts",
+ "destination": "src/chat/core/conversation-runs.ts",
+ "sourceSha256": "ef9d5a2fa022f31c5587e277e22fec61840491dd5ef365c15137f6dac9c8a904",
+ "destinationSha256": "ef9d5a2fa022f31c5587e277e22fec61840491dd5ef365c15137f6dac9c8a904",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/conversation-threads.ts",
+ "destination": "src/chat/core/conversation-threads.ts",
+ "sourceSha256": "d403eb349d006dbd605bf2b1110cf0010918ec27971b8766f938109d16aaed25",
+ "destinationSha256": "d403eb349d006dbd605bf2b1110cf0010918ec27971b8766f938109d16aaed25",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/copy-bot.ts",
+ "destination": "src/chat/core/copy-bot.ts",
+ "sourceSha256": "615e42cf5f6648530a65bec85a9bb65a78b125a31806d9220bfe5fd925a51ed3",
+ "destinationSha256": "615e42cf5f6648530a65bec85a9bb65a78b125a31806d9220bfe5fd925a51ed3",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/delegated-task-view.ts",
+ "destination": "src/chat/core/delegated-task-view.ts",
+ "sourceSha256": "5267a60ce41c77c9dbd80c62905499172f539b4e1c9370d7e9c6102be88176ae",
+ "destinationSha256": "5267a60ce41c77c9dbd80c62905499172f539b4e1c9370d7e9c6102be88176ae",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/delegation-budget.ts",
+ "destination": "src/chat/core/delegation-budget.ts",
+ "sourceSha256": "c1ee7d6b6e9aa447a2a0c6d9f624d901e1e643633f6266713c74c46eb3b6ef63",
+ "destinationSha256": "c1ee7d6b6e9aa447a2a0c6d9f624d901e1e643633f6266713c74c46eb3b6ef63",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/delegation-report.ts",
+ "destination": "src/chat/core/delegation-report.ts",
+ "sourceSha256": "8c93e7d523f0bf8efcfb895f8b59553cdb3d5bf392954b80edfeaeb41661685d",
+ "destinationSha256": "8c93e7d523f0bf8efcfb895f8b59553cdb3d5bf392954b80edfeaeb41661685d",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/delegation-sources.ts",
+ "destination": "src/chat/core/delegation-sources.ts",
+ "sourceSha256": "e840f7a0f0c8912ae7f592145a8d3c7844774afadd87e4e9f2c5ad87e48f503a",
+ "destinationSha256": "e840f7a0f0c8912ae7f592145a8d3c7844774afadd87e4e9f2c5ad87e48f503a",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/delegation-wait.ts",
+ "destination": "src/chat/core/delegation-wait.ts",
+ "sourceSha256": "bc08e8ac569bbdbf241e2a32847fce92858204a3f839af418be8e051c09264ab",
+ "destinationSha256": "bc08e8ac569bbdbf241e2a32847fce92858204a3f839af418be8e051c09264ab",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/delegation.ts",
+ "destination": "src/chat/core/delegation.ts",
+ "sourceSha256": "031a01f85865fc870fe645ee163bf55f7c981ca4b4d2e808c0c2121b65e44145",
+ "destinationSha256": "031a01f85865fc870fe645ee163bf55f7c981ca4b4d2e808c0c2121b65e44145",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/execution-artifact.ts",
+ "destination": "src/chat/core/execution-artifact.ts",
+ "sourceSha256": "5df96dc5ba11f68c74b5ffc53c02fe18a2a6516870d4c9eb599776253626a864",
+ "destinationSha256": "5df96dc5ba11f68c74b5ffc53c02fe18a2a6516870d4c9eb599776253626a864",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/execution-bridge.ts",
+ "destination": "src/chat/core/execution-bridge.ts",
+ "sourceSha256": "93f820e97c8d16bcaecf1509da7690285818fa875feb6c6529a1ed27a9bd5705",
+ "destinationSha256": "93f820e97c8d16bcaecf1509da7690285818fa875feb6c6529a1ed27a9bd5705",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/execution-events.ts",
+ "destination": "src/chat/core/execution-events.ts",
+ "sourceSha256": "919b10029c53d6cb4b61010278e80d6837ca102dc8e809637515bd40963e9b50",
+ "destinationSha256": "919b10029c53d6cb4b61010278e80d6837ca102dc8e809637515bd40963e9b50",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/execution-preview.ts",
+ "destination": "src/chat/core/execution-preview.ts",
+ "sourceSha256": "f9755ff105bcc3274a2cdbdd5e533c63906d085cabcdfed79083a4fb697a1e4c",
+ "destinationSha256": "f9755ff105bcc3274a2cdbdd5e533c63906d085cabcdfed79083a4fb697a1e4c",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/execution-project-snapshot.ts",
+ "destination": "src/chat/core/execution-project-snapshot.ts",
+ "sourceSha256": "bf11713d1a49ab101f3ac0dc31b98d0f5fc2410f5bff0b290b3c941dd65403cb",
+ "destinationSha256": "bf11713d1a49ab101f3ac0dc31b98d0f5fc2410f5bff0b290b3c941dd65403cb",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/execution-sessions.ts",
+ "destination": "src/chat/core/execution-sessions.ts",
+ "sourceSha256": "a70dd9126bb7bcb8abcb24144cad090eca0476b166a093e029bb16bd103e5fdc",
+ "destinationSha256": "a70dd9126bb7bcb8abcb24144cad090eca0476b166a093e029bb16bd103e5fdc",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/execution-snapshot.ts",
+ "destination": "src/chat/core/execution-snapshot.ts",
+ "sourceSha256": "9949af35f10d0512882eb5818a1d0373d78430cae46f7dd759bf3c59899dd895",
+ "destinationSha256": "9949af35f10d0512882eb5818a1d0373d78430cae46f7dd759bf3c59899dd895",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/file-deliveries.ts",
+ "destination": "src/chat/core/file-deliveries.ts",
+ "sourceSha256": "4e57803bc4e0b08a42231ced899297abd5c156661e2f3e86d1e3b83b5703979f",
+ "destinationSha256": "4e57803bc4e0b08a42231ced899297abd5c156661e2f3e86d1e3b83b5703979f",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/file-diff.ts",
+ "destination": "src/chat/core/file-diff.ts",
+ "sourceSha256": "cdf9b0e6e2f49ab9f6ce09553df0a9f122f3311586e09976773a4f60c9fd0508",
+ "destinationSha256": "cdf9b0e6e2f49ab9f6ce09553df0a9f122f3311586e09976773a4f60c9fd0508",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/files.ts",
+ "destination": "src/chat/core/files.ts",
+ "sourceSha256": "26d8e807fbaa9bd34b2d82a6688810971a370c3553504fe56e18adcf19dafd30",
+ "destinationSha256": "899f749c3fa6dd671399161519b16d53fd7f45cce965955043a92ac89ae65668",
+ "unchanged": false,
+ "adaptation": "Workspace URL namespace moved from /w to /chat/w"
+ },
+ {
+ "source": "src/core/home-navigation.ts",
+ "destination": "src/chat/core/home-navigation.ts",
+ "sourceSha256": "a4025f5d531614bee229d08cbb3d82a6dad58713e43155368621382752fe73a7",
+ "destinationSha256": "a4025f5d531614bee229d08cbb3d82a6dad58713e43155368621382752fe73a7",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-account.ts",
+ "destination": "src/chat/core/kody-account.ts",
+ "sourceSha256": "7b7dd9755fa483144585a9e127175437533fc992670cbcb8e5818b97b3791bfc",
+ "destinationSha256": "7b7dd9755fa483144585a9e127175437533fc992670cbcb8e5818b97b3791bfc",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-community.ts",
+ "destination": "src/chat/core/kody-community.ts",
+ "sourceSha256": "3aba6b98d7e382b600ee0956fcadf832e411a02a29c811f17ee35d4a5fc66217",
+ "destinationSha256": "3aba6b98d7e382b600ee0956fcadf832e411a02a29c811f17ee35d4a5fc66217",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-jobs.ts",
+ "destination": "src/chat/core/kody-jobs.ts",
+ "sourceSha256": "d64a445153a6aee7511aeb1e21807686e0b05f3b9101a8ac5d7450ad220274e8",
+ "destinationSha256": "d64a445153a6aee7511aeb1e21807686e0b05f3b9101a8ac5d7450ad220274e8",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-mail.ts",
+ "destination": "src/chat/core/kody-mail.ts",
+ "sourceSha256": "e0cff92b947d7d9867a23923b44a0472213e615f9021e459e0d56e9cc31a5ede",
+ "destinationSha256": "e0cff92b947d7d9867a23923b44a0472213e615f9021e459e0d56e9cc31a5ede",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-memory.ts",
+ "destination": "src/chat/core/kody-memory.ts",
+ "sourceSha256": "f9d01824bcdcec4b025a55783010da76a7128c53d1235e2d91cc70a8a9300406",
+ "destinationSha256": "f9d01824bcdcec4b025a55783010da76a7128c53d1235e2d91cc70a8a9300406",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-package-document.ts",
+ "destination": "src/chat/core/kody-package-document.ts",
+ "sourceSha256": "b444038e8f5485318a62580870173eb0516df5ebcb09a30ed82bea74fdec6194",
+ "destinationSha256": "b444038e8f5485318a62580870173eb0516df5ebcb09a30ed82bea74fdec6194",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-reference-detail.ts",
+ "destination": "src/chat/core/kody-reference-detail.ts",
+ "sourceSha256": "85449eabe8170dadfe72011c65bd70fcaaa01bb3ad7d68be424d260845873f62",
+ "destinationSha256": "85449eabe8170dadfe72011c65bd70fcaaa01bb3ad7d68be424d260845873f62",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-resources.ts",
+ "destination": "src/chat/core/kody-resources.ts",
+ "sourceSha256": "d90f8921c86f139d87ff67267fabcda1a7aa9a9216b92548d4dac948e0e7f857",
+ "destinationSha256": "d90f8921c86f139d87ff67267fabcda1a7aa9a9216b92548d4dac948e0e7f857",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-run-history.ts",
+ "destination": "src/chat/core/kody-run-history.ts",
+ "sourceSha256": "a60ccb26449b39d7e2216efdb12ed5f777ead28dfb2b0736a70a067ebb9c5ef2",
+ "destinationSha256": "a60ccb26449b39d7e2216efdb12ed5f777ead28dfb2b0736a70a067ebb9c5ef2",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-run.ts",
+ "destination": "src/chat/core/kody-run.ts",
+ "sourceSha256": "0fbf8f20cdd2cce6976c890879034e7ee233faf87e28ac4362a6ac1e0cf81556",
+ "destinationSha256": "0fbf8f20cdd2cce6976c890879034e7ee233faf87e28ac4362a6ac1e0cf81556",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-servers.ts",
+ "destination": "src/chat/core/kody-servers.ts",
+ "sourceSha256": "b4ca6b2eb37562915d6ccff07d901f8255ee058298390b573fa3ce72b3bd2705",
+ "destinationSha256": "b4ca6b2eb37562915d6ccff07d901f8255ee058298390b573fa3ce72b3bd2705",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/kody-usage.ts",
+ "destination": "src/chat/core/kody-usage.ts",
+ "sourceSha256": "4fb8aa5f379ba544ed2ece2946b536e92f56d1b16642158235c0a42a5503ba37",
+ "destinationSha256": "4fb8aa5f379ba544ed2ece2946b536e92f56d1b16642158235c0a42a5503ba37",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/markdown-links.ts",
+ "destination": "src/chat/core/markdown-links.ts",
+ "sourceSha256": "f7892b06492373acea6769da86d0084c9e8a18dbaa7c29dbda21d86b210c4d27",
+ "destinationSha256": "f7892b06492373acea6769da86d0084c9e8a18dbaa7c29dbda21d86b210c4d27",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/mcp-accounts.ts",
+ "destination": "src/chat/core/mcp-accounts.ts",
+ "sourceSha256": "ce873ffa48cafa9a38bc6067c9becf773237e83e33f3a3c3a98c8e6670f9b02e",
+ "destinationSha256": "ce873ffa48cafa9a38bc6067c9becf773237e83e33f3a3c3a98c8e6670f9b02e",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/mcp-setup.ts",
+ "destination": "src/chat/core/mcp-setup.ts",
+ "sourceSha256": "b61052ee4122dfb462c5937bcfc25f9913b2ed0a8f8428c0fde2f63c12785d0b",
+ "destinationSha256": "b61052ee4122dfb462c5937bcfc25f9913b2ed0a8f8428c0fde2f63c12785d0b",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/memory-expiry.ts",
+ "destination": "src/chat/core/memory-expiry.ts",
+ "sourceSha256": "679c631a97226e35795998e625cf1db4b2027d495699e9d14aa599f7a07fc8e4",
+ "destinationSha256": "679c631a97226e35795998e625cf1db4b2027d495699e9d14aa599f7a07fc8e4",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/memory.ts",
+ "destination": "src/chat/core/memory.ts",
+ "sourceSha256": "389b5528c916f17b8e317ba60891bc676205e638800783eb476866d284aabbee",
+ "destinationSha256": "389b5528c916f17b8e317ba60891bc676205e638800783eb476866d284aabbee",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/message-attachments.ts",
+ "destination": "src/chat/core/message-attachments.ts",
+ "sourceSha256": "ab063353cf84b82c5753ec27d1fc19e0d881cd45f49b59c6c8718daf9198e917",
+ "destinationSha256": "ab063353cf84b82c5753ec27d1fc19e0d881cd45f49b59c6c8718daf9198e917",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/message-navigation.ts",
+ "destination": "src/chat/core/message-navigation.ts",
+ "sourceSha256": "9d19e4a92c477f95377a47db8db3e97b730837b8aeae36e62bc27a9e3ea23e61",
+ "destinationSha256": "9d19e4a92c477f95377a47db8db3e97b730837b8aeae36e62bc27a9e3ea23e61",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/message-references.ts",
+ "destination": "src/chat/core/message-references.ts",
+ "sourceSha256": "9d983466b1ff8d62c1a16c042830f75d265c2bf1312419c70c3481a7c458f868",
+ "destinationSha256": "9d983466b1ff8d62c1a16c042830f75d265c2bf1312419c70c3481a7c458f868",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/navigation.ts",
+ "destination": "src/chat/core/navigation.ts",
+ "sourceSha256": "e37a11d13bc597198edb1f38911a7e46dae648b98372af50881cf8bda97411d9",
+ "destinationSha256": "895907b5b1906d800ed21ebabd71c274df14b19ca56e01346cbb422742d4bc10",
+ "unchanged": false,
+ "adaptation": "Workspace links and sign-in destination prefix moved to /chat/w/, retaining original bounds and redirect guards."
+ },
+ {
+ "source": "src/core/onboarding.ts",
+ "destination": "src/chat/core/onboarding.ts",
+ "sourceSha256": "da3a01d493e93fc5bbad5e3a2543c9cc530dd046cabb59a8d726ef5893ab6eef",
+ "destinationSha256": "da3a01d493e93fc5bbad5e3a2543c9cc530dd046cabb59a8d726ef5893ab6eef",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/plugin-archive.ts",
+ "destination": "src/chat/core/plugin-archive.ts",
+ "sourceSha256": "352c38a6df7f4e5c84815f3502e7441ad22d28c8f4472b80cfe97977c8ca070f",
+ "destinationSha256": "352c38a6df7f4e5c84815f3502e7441ad22d28c8f4472b80cfe97977c8ca070f",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/plugin-lifecycle.ts",
+ "destination": "src/chat/core/plugin-lifecycle.ts",
+ "sourceSha256": "bd5af2c18c1305c1259d1996a56a22923a08a42dbf5c9668924ef93f2f3e1c0d",
+ "destinationSha256": "bd5af2c18c1305c1259d1996a56a22923a08a42dbf5c9668924ef93f2f3e1c0d",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/plugins.ts",
+ "destination": "src/chat/core/plugins.ts",
+ "sourceSha256": "24ae0816c6d2968a058a0a00a898a9fcd3da7f59d66dc1fd9d83b1e6a62689ab",
+ "destinationSha256": "24ae0816c6d2968a058a0a00a898a9fcd3da7f59d66dc1fd9d83b1e6a62689ab",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/preload-recovery.ts",
+ "destination": "src/chat/core/preload-recovery.ts",
+ "sourceSha256": "72fbd487b8fe3e3d5e03da2c314954612ffb855f1f4fdba106ceeb0a340c5940",
+ "destinationSha256": "72fbd487b8fe3e3d5e03da2c314954612ffb855f1f4fdba106ceeb0a340c5940",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/provider-request-shape.ts",
+ "destination": "src/chat/core/provider-request-shape.ts",
+ "sourceSha256": "3982fbc4fc76d03335ef5634b08f2debb99de578458c6752febf6c8146208a11",
+ "destinationSha256": "3982fbc4fc76d03335ef5634b08f2debb99de578458c6752febf6c8146208a11",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/research-loop.ts",
+ "destination": "src/chat/core/research-loop.ts",
+ "sourceSha256": "1d4cf53d7e4e8f7d75c04104ebead5008edbd9b1a9d49cb2c0cca6ac436a8486",
+ "destinationSha256": "1d4cf53d7e4e8f7d75c04104ebead5008edbd9b1a9d49cb2c0cca6ac436a8486",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/retry-draft-editor.ts",
+ "destination": "src/chat/core/retry-draft-editor.ts",
+ "sourceSha256": "dc5a1c097c1b7817cc24e2d17d9b5af3a0d60b7ec4bbfbc2bceddf4428d0c2dd",
+ "destinationSha256": "dc5a1c097c1b7817cc24e2d17d9b5af3a0d60b7ec4bbfbc2bceddf4428d0c2dd",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/retry-draft.ts",
+ "destination": "src/chat/core/retry-draft.ts",
+ "sourceSha256": "0d26f0d420028fe8295f7a1530c62883f257c795e7d3d14bc1c0dfa6a5eff26c",
+ "destinationSha256": "0d26f0d420028fe8295f7a1530c62883f257c795e7d3d14bc1c0dfa6a5eff26c",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/retry-files.ts",
+ "destination": "src/chat/core/retry-files.ts",
+ "sourceSha256": "ea25fb98e44d7388a31ef0f6b0c11828cf0a0cf2daf7724fc4be49bd27d12461",
+ "destinationSha256": "ea25fb98e44d7388a31ef0f6b0c11828cf0a0cf2daf7724fc4be49bd27d12461",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/retry-preparation.ts",
+ "destination": "src/chat/core/retry-preparation.ts",
+ "sourceSha256": "27e25cf359e02ffceb3a01e5cac32696eab6ec23e2715fc1207d858585e3fdd9",
+ "destinationSha256": "27e25cf359e02ffceb3a01e5cac32696eab6ec23e2715fc1207d858585e3fdd9",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/retry-request.ts",
+ "destination": "src/chat/core/retry-request.ts",
+ "sourceSha256": "08f124ead6576d86c64fd0b6c5989b4dfa15ac63e53b98fc8e406ca9ec30299e",
+ "destinationSha256": "08f124ead6576d86c64fd0b6c5989b4dfa15ac63e53b98fc8e406ca9ec30299e",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/retry-source.ts",
+ "destination": "src/chat/core/retry-source.ts",
+ "sourceSha256": "3ec8bb85ff1ee4b0bdc84bcff2abb539c08756c372a541e0b809f7a980954720",
+ "destinationSha256": "3ec8bb85ff1ee4b0bdc84bcff2abb539c08756c372a541e0b809f7a980954720",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/routing.ts",
+ "destination": "src/chat/core/routing.ts",
+ "sourceSha256": "6b77a2085db89d374bc050ee6c58220c439a87428c321bd5fc7c1ec4594dd404",
+ "destinationSha256": "6b77a2085db89d374bc050ee6c58220c439a87428c321bd5fc7c1ec4594dd404",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/run-model.ts",
+ "destination": "src/chat/core/run-model.ts",
+ "sourceSha256": "fba4abd59bf818b2824b714b156d9a319a941888d9b01f45bc3e03785021007f",
+ "destinationSha256": "fba4abd59bf818b2824b714b156d9a319a941888d9b01f45bc3e03785021007f",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/schedule-preview.ts",
+ "destination": "src/chat/core/schedule-preview.ts",
+ "sourceSha256": "470ab4721f69d58e47ff8702a10b31a67858088811bb294424a7c8e57f0884e1",
+ "destinationSha256": "470ab4721f69d58e47ff8702a10b31a67858088811bb294424a7c8e57f0884e1",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/schedules.ts",
+ "destination": "src/chat/core/schedules.ts",
+ "sourceSha256": "a16203423df5526a43a78ec2c98762cf67707797c5c48c82e2c2a05cb281c4db",
+ "destinationSha256": "a16203423df5526a43a78ec2c98762cf67707797c5c48c82e2c2a05cb281c4db",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/send-receipt.ts",
+ "destination": "src/chat/core/send-receipt.ts",
+ "sourceSha256": "b2f76d1b47cdccea7af861567d18dcdd0eb865523219deccfc900eea65510755",
+ "destinationSha256": "b2f76d1b47cdccea7af861567d18dcdd0eb865523219deccfc900eea65510755",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/sketch.ts",
+ "destination": "src/chat/core/sketch.ts",
+ "sourceSha256": "9d606f208adfcfb9fe2432060511f2e89b4699942e8cad90f8d3e1c15a5e384f",
+ "destinationSha256": "9d606f208adfcfb9fe2432060511f2e89b4699942e8cad90f8d3e1c15a5e384f",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/skill-identifiers.ts",
+ "destination": "src/chat/core/skill-identifiers.ts",
+ "sourceSha256": "88d40ecb9b6be14ab99395d31bea35755c04f6e9ae90d39b48556313c5e062ea",
+ "destinationSha256": "88d40ecb9b6be14ab99395d31bea35755c04f6e9ae90d39b48556313c5e062ea",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/skills.ts",
+ "destination": "src/chat/core/skills.ts",
+ "sourceSha256": "8da4fc314391b6a44a743f07e03ca5db53ae361b6d51b5d23594850db91edd10",
+ "destinationSha256": "8da4fc314391b6a44a743f07e03ca5db53ae361b6d51b5d23594850db91edd10",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/task-context.ts",
+ "destination": "src/chat/core/task-context.ts",
+ "sourceSha256": "adf7fa44c2ff08e4fba64b54a975edd994bd1e1de2a07fa09949cab0f0303232",
+ "destinationSha256": "adf7fa44c2ff08e4fba64b54a975edd994bd1e1de2a07fa09949cab0f0303232",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/task-usage.ts",
+ "destination": "src/chat/core/task-usage.ts",
+ "sourceSha256": "b6f886aa9447937736e956a2f928eed01bcaefd4d3b8b5e11fec8101ce09c288",
+ "destinationSha256": "b6f886aa9447937736e956a2f928eed01bcaefd4d3b8b5e11fec8101ce09c288",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/tasks.ts",
+ "destination": "src/chat/core/tasks.ts",
+ "sourceSha256": "d624e241b26e18db32ae0eadff8b9a8507fa43fa8af5b2001f492c28ed603569",
+ "destinationSha256": "d624e241b26e18db32ae0eadff8b9a8507fa43fa8af5b2001f492c28ed603569",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/tool-evidence.ts",
+ "destination": "src/chat/core/tool-evidence.ts",
+ "sourceSha256": "9ec7d472a7795f70840f5bcb647b213497276e35c48b8607c53dc87715433760",
+ "destinationSha256": "9ec7d472a7795f70840f5bcb647b213497276e35c48b8607c53dc87715433760",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/transcript-navigation.ts",
+ "destination": "src/chat/core/transcript-navigation.ts",
+ "sourceSha256": "ebc1fcf74f753f9fa431ead28302cb2eeea1d1fcc341babc0c93bfefdab867e6",
+ "destinationSha256": "ebc1fcf74f753f9fa431ead28302cb2eeea1d1fcc341babc0c93bfefdab867e6",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/transcript.ts",
+ "destination": "src/chat/core/transcript.ts",
+ "sourceSha256": "3e46efd7d9c3fa06739605a96c5fc3139511b2b08b42095c6d745fbabb009dfa",
+ "destinationSha256": "3e46efd7d9c3fa06739605a96c5fc3139511b2b08b42095c6d745fbabb009dfa",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/types.ts",
+ "destination": "src/chat/core/types.ts",
+ "sourceSha256": "6d7ceb432a6ff47dc1b6130a69abfc49b955b083b3b731ecaa771c401afbfae7",
+ "destinationSha256": "0b56d1e6ebd849ef1c0dc52739f026f422660acee11478bc72ccc3796dab6fb1",
+ "unchanged": false
+ },
+ {
+ "source": "src/core/usage.ts",
+ "destination": "src/chat/core/usage.ts",
+ "sourceSha256": "680d7bab935678aed5bf3bdeb61529c2df552dcb41e911f2764b556addaf7225",
+ "destinationSha256": "680d7bab935678aed5bf3bdeb61529c2df552dcb41e911f2764b556addaf7225",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workflow-admission.ts",
+ "destination": "src/chat/core/workflow-admission.ts",
+ "sourceSha256": "26d611bd4a7070720ae531486f886dfd13381db1885a32194490e0dce9a22408",
+ "destinationSha256": "26d611bd4a7070720ae531486f886dfd13381db1885a32194490e0dce9a22408",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workflow-input-reference.ts",
+ "destination": "src/chat/core/workflow-input-reference.ts",
+ "sourceSha256": "76b817bc5bc9d5ae4f105c24e97a66ac6a90b24fcab9785a570d18901b12e125",
+ "destinationSha256": "76b817bc5bc9d5ae4f105c24e97a66ac6a90b24fcab9785a570d18901b12e125",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workflow-inspection.ts",
+ "destination": "src/chat/core/workflow-inspection.ts",
+ "sourceSha256": "1a64de54017253ccad8a552f11f24e3d28c26eb6582ae6e7179f7cecef52b933",
+ "destinationSha256": "1a64de54017253ccad8a552f11f24e3d28c26eb6582ae6e7179f7cecef52b933",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workflow-operation.ts",
+ "destination": "src/chat/core/workflow-operation.ts",
+ "sourceSha256": "4ce341650ab0432d8b13162a95150f6c080bb06d6bc01374d46536dac7c990a8",
+ "destinationSha256": "4ce341650ab0432d8b13162a95150f6c080bb06d6bc01374d46536dac7c990a8",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workflow-runs.ts",
+ "destination": "src/chat/core/workflow-runs.ts",
+ "sourceSha256": "cc99da1ee5f3dfbd4ee8798e6721e579b9ccb1eaef7dae26c2d33ab5a30eb479",
+ "destinationSha256": "cc99da1ee5f3dfbd4ee8798e6721e579b9ccb1eaef7dae26c2d33ab5a30eb479",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workflow-start.ts",
+ "destination": "src/chat/core/workflow-start.ts",
+ "sourceSha256": "e6ebee4f13e0335dc519c26cf8cd0fb38d62eed05a8d64b80b685c546f8fad64",
+ "destinationSha256": "e6ebee4f13e0335dc519c26cf8cd0fb38d62eed05a8d64b80b685c546f8fad64",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workflow-usage.ts",
+ "destination": "src/chat/core/workflow-usage.ts",
+ "sourceSha256": "dcc027802cca759e173eba63db83bc5d0aaff6d0e9f261d8ce2198e37da162b7",
+ "destinationSha256": "dcc027802cca759e173eba63db83bc5d0aaff6d0e9f261d8ce2198e37da162b7",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workflows.ts",
+ "destination": "src/chat/core/workflows.ts",
+ "sourceSha256": "f8afb6e9429cb1cfcfab44ecbcaed4b298217b0cb12c21e19415b450dc2a4835",
+ "destinationSha256": "f8afb6e9429cb1cfcfab44ecbcaed4b298217b0cb12c21e19415b450dc2a4835",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workspace-history.ts",
+ "destination": "src/chat/core/workspace-history.ts",
+ "sourceSha256": "1baca54d6b90d1fd8450148f5b844ab93f45ded425d2eb629832892e745ed8f7",
+ "destinationSha256": "1baca54d6b90d1fd8450148f5b844ab93f45ded425d2eb629832892e745ed8f7",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workspace-index.ts",
+ "destination": "src/chat/core/workspace-index.ts",
+ "sourceSha256": "d3c71048b836576d355be141b3bbf3a9a30c2665a827f08f175e72b726940563",
+ "destinationSha256": "d3c71048b836576d355be141b3bbf3a9a30c2665a827f08f175e72b726940563",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workspace-panels.ts",
+ "destination": "src/chat/core/workspace-panels.ts",
+ "sourceSha256": "a80f3a4012083c3d733df638ae2558c94f18f63f6387a0ad5d73a212eee31554",
+ "destinationSha256": "a80f3a4012083c3d733df638ae2558c94f18f63f6387a0ad5d73a212eee31554",
+ "unchanged": true
+ },
+ {
+ "source": "src/core/workspace-sync.ts",
+ "destination": "src/chat/core/workspace-sync.ts",
+ "sourceSha256": "3a6e66c8f7ed3c3222db8978c27a2782e1d7cc75e46b0b08342fe91910bd9527",
+ "destinationSha256": "3a6e66c8f7ed3c3222db8978c27a2782e1d7cc75e46b0b08342fe91910bd9527",
+ "unchanged": true
+ }
+]
diff --git a/docs/tanchat-desktop-port.json b/docs/tanchat-desktop-port.json
new file mode 100644
index 000000000..17544c6d0
--- /dev/null
+++ b/docs/tanchat-desktop-port.json
@@ -0,0 +1,157 @@
+[
+ {
+ "source": "desktop/assets/README.md",
+ "destination": "desktop/assets/README.md",
+ "sourceSha256": "9c0575168b0f1f5ae227d31e77d0d780344af292ef2521427d22b3b08f70f7e0",
+ "destinationSha256": "9c0575168b0f1f5ae227d31e77d0d780344af292ef2521427d22b3b08f70f7e0",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/assets/kody-icon.png",
+ "destination": "desktop/assets/kody-icon.png",
+ "sourceSha256": "66f85a49eaa3ef356ce944408137c7e0ffe5d99e608105b9c2d9b54c27b5828a",
+ "destinationSha256": "66f85a49eaa3ef356ce944408137c7e0ffe5d99e608105b9c2d9b54c27b5828a",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/assets/kody-square.png",
+ "destination": "desktop/assets/kody-square.png",
+ "sourceSha256": "098ca8fcc5ec0c35032c711c06775b9181993b59fc0ea8becb35c84c807802da",
+ "destinationSha256": "098ca8fcc5ec0c35032c711c06775b9181993b59fc0ea8becb35c84c807802da",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/assets/kody-squircle.png",
+ "destination": "desktop/assets/kody-squircle.png",
+ "sourceSha256": "e714fee3da324d3c053f062845bb247ab6b2c6525335f1960c84b441fc8928f0",
+ "destinationSha256": "e714fee3da324d3c053f062845bb247ab6b2c6525335f1960c84b441fc8928f0",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/build-device-helper.mjs",
+ "destination": "desktop/build-device-helper.mjs",
+ "sourceSha256": "05e74361d2f210bd5d887d63da86ece28ffbe30c2c7017e5121a5c0e9d21ef54",
+ "destinationSha256": "05e74361d2f210bd5d887d63da86ece28ffbe30c2c7017e5121a5c0e9d21ef54",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/builder.config.cjs",
+ "destination": "desktop/builder.config.mjs",
+ "sourceSha256": "8c99c75b9a7a1f3dc5aa35af0307fce332242b0fb7762f3769d8e17f7e9e9dff",
+ "destinationSha256": "605ff8a552776802f417b29734651df595ff62195b9c57f81b1a543a94b02ebe",
+ "unchanged": false,
+ "adaptation": "Original Electron Builder configuration converted to ES modules, with TanStack application identity and the existing site logo. Packaging commands load this .mjs file."
+ },
+ {
+ "source": "desktop/connected-device.mjs",
+ "destination": "desktop/connected-device.mjs",
+ "sourceSha256": "665b4ada07d44a1f2050e6953948c6485732b096f6a2b647145c3b096d656322",
+ "destinationSha256": "1b0834367532bb587d1eeed80ee02e658e1c3b9d5bcfc34b4b1e00b21a23547b",
+ "unchanged": false
+ },
+ {
+ "source": "desktop/connected-device.test.mjs",
+ "destination": "desktop/connected-device.test.mjs",
+ "sourceSha256": "b2cd69a5f796d834c7c5245958c5dac75aed134880819a9b1e5356449dd42e23",
+ "destinationSha256": "b2cd69a5f796d834c7c5245958c5dac75aed134880819a9b1e5356449dd42e23",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/device-folders.mjs",
+ "destination": "desktop/device-folders.mjs",
+ "sourceSha256": "7a79ca0a68bf62d3688f4c58a224ed8790496aef632f031edf42deddba5ad13f",
+ "destinationSha256": "7a79ca0a68bf62d3688f4c58a224ed8790496aef632f031edf42deddba5ad13f",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/device-folders.test.mjs",
+ "destination": "desktop/device-folders.test.mjs",
+ "sourceSha256": "17adc9decd37be2c9de685e21bdfb39cee1ca4b5c221374c813e85a17693939e",
+ "destinationSha256": "17adc9decd37be2c9de685e21bdfb39cee1ca4b5c221374c813e85a17693939e",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/external-links.mjs",
+ "destination": "desktop/external-links.mjs",
+ "sourceSha256": "b969c53a48f58af67315ca7fbc9d1fc6d027dbfdfef86cb83e41255bdedf0273",
+ "destinationSha256": "b969c53a48f58af67315ca7fbc9d1fc6d027dbfdfef86cb83e41255bdedf0273",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/external-links.test.mjs",
+ "destination": "desktop/external-links.test.mjs",
+ "sourceSha256": "737fa97e0cdc4bdf226b96477528c8741ea7f9d014765c40c7fdfe8c5b5129b9",
+ "destinationSha256": "737fa97e0cdc4bdf226b96477528c8741ea7f9d014765c40c7fdfe8c5b5129b9",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/main.mjs",
+ "destination": "desktop/main.mjs",
+ "sourceSha256": "d1df0bb614bfce6047eb2f08b9ae1723daff51dc25441f4c1f4f67f764a53e5e",
+ "destinationSha256": "c53ca36e0f1690379343daa6a59af3476ff1c75b45312d2d9047fb9df920aff7",
+ "unchanged": false
+ },
+ {
+ "source": "desktop/native/folder-access.c",
+ "destination": "desktop/native/folder-access.c",
+ "sourceSha256": "4f02622c6f6c5ef24dc6d3e0ed58ae2e121faafa07beb08039cbcfe9e9bc97c1",
+ "destinationSha256": "4f02622c6f6c5ef24dc6d3e0ed58ae2e121faafa07beb08039cbcfe9e9bc97c1",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/package.json",
+ "destination": "desktop/package.json",
+ "sourceSha256": "65d8fe7c7dd9a8b3ff1ecb1f09ad397e01e25b3e2d095db7fc5a1499118a3e0d",
+ "destinationSha256": "aea4f84e9c99ed5344fcf8d5e045802abaeed369e2e9ec6fd71ae18d42ae7dca",
+ "unchanged": false
+ },
+ {
+ "source": "desktop/preload.cjs",
+ "destination": "desktop/preload.cjs",
+ "sourceSha256": "3aed61630c3cf53179693a817dfad4bda2c234e8b3b3df227688cfee7b405a37",
+ "destinationSha256": "3aed61630c3cf53179693a817dfad4bda2c234e8b3b3df227688cfee7b405a37",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/preload.test.mjs",
+ "destination": "desktop/preload.test.mjs",
+ "sourceSha256": "7624315d2de075a1ddba5323c5ec04c88e401f83151b318fe65bed74b2ea8b27",
+ "destinationSha256": "7624315d2de075a1ddba5323c5ec04c88e401f83151b318fe65bed74b2ea8b27",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/runtime-config.mjs",
+ "destination": "desktop/runtime-config.mjs",
+ "sourceSha256": "cea70c7db40b838cf17423f5ea1ad125109d48512070c238048a76da45108687",
+ "destinationSha256": "f5199e710769dd6d4371e63169801b10293ffd575b4fba0353008aeface80189",
+ "unchanged": false
+ },
+ {
+ "source": "desktop/runtime-config.test.mjs",
+ "destination": "desktop/runtime-config.test.mjs",
+ "sourceSha256": "0635f91759cbaeebb2d625d403683077eb9216ce9d1f646294a72af2f2ee8713",
+ "destinationSha256": "bc6a2a65dd88419e40c220aafca2220c23f741f6fa795f83084083f25e048b9e",
+ "unchanged": false
+ },
+ {
+ "source": "desktop/updates.mjs",
+ "destination": "desktop/updates.mjs",
+ "sourceSha256": "724180d585eb9aa3c519c8d4cd91776b164dac990e7c9f7a60a5c9c603b22b40",
+ "destinationSha256": "724180d585eb9aa3c519c8d4cd91776b164dac990e7c9f7a60a5c9c603b22b40",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/updates.test.mjs",
+ "destination": "desktop/updates.test.mjs",
+ "sourceSha256": "e5b5b9c50f2e6ade259106a62a696ef25e7f7ebe43f9110bd25602f8e0d6260e",
+ "destinationSha256": "e5b5b9c50f2e6ade259106a62a696ef25e7f7ebe43f9110bd25602f8e0d6260e",
+ "unchanged": true
+ },
+ {
+ "source": "desktop/windows.test.mjs",
+ "destination": "desktop/windows.test.mjs",
+ "sourceSha256": "af2f9b052e5001b61049e947ddd3cbaf9e1d8f51228d942bf23d524fd638ad6c",
+ "destinationSha256": "ed0ae29d97fce963bb970e675ab9e417039a2bda01a276ff583b709f632734b6",
+ "unchanged": false
+ }
+]
diff --git a/docs/tanchat-execution-adaptation.md b/docs/tanchat-execution-adaptation.md
new file mode 100644
index 000000000..9df1e8596
--- /dev/null
+++ b/docs/tanchat-execution-adaptation.md
@@ -0,0 +1,27 @@
+# Chat execution adaptation
+
+The current chat execution bridge is not connected to the shared site's SDK runtime. Preserve the server lease, command registry, receipt, replay and snapshot contracts while replacing that host transport.
+
+The installed API 6 SDK exposes HostedKernel, an isolated-frame client with an expectedBuildId handshake. It already provides the operations below. Reuse it instead of implementing another kernel, file system, process manager or preview renderer.
+
+| Chat operation | Existing SDK operation | Required chat contract |
+| --------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------- |
+| read_file | HostedKernel.readFile/readText | Preserve output byte limits, authorized paths and exact committed delivery identity |
+| write_file | HostedKernel.writeFile/writeText | Preserve payload limits and mutation receipts |
+| run | HostedKernel.run or bounded spawned process | Preserve exit, output, stop and uncertain-outcome evidence |
+| spawn | HostedKernel.spawn | Bind returned process to the reserved chat processId and drain bounded output |
+| stop_process | Process kill/dispose | Acknowledge actual cleanup, retain unknown when cleanup cannot be proved |
+| preview_open | HostedKernel.mountPreview | Bind the preview to its reserved ID and existing viewport ownership |
+| preview_inspect | Preview.inspect | Bound and validate returned evidence |
+| preview_click | Preview.click | Preserve approval and delivery identity |
+| preview_close | Preview.close | Confirm exact preview cleanup |
+| save_snapshot | HostedKernel.snapshot | Encode through the existing immutable snapshot format, do not substitute a browser checkpoint key |
+| close | HostedKernel.close/shutdown | Preserve cooperative shutdown evidence, disconnect alone does not prove cleanup |
+
+Use the existing ExecutionHostBridge boundary. ExecutionOwnersProvider owns one runtime service above conversation routes. Pane hiding must continue to leave that service alive, route/account teardown must revoke it, and hot module replacement must revoke the previous executable owner. Existing server APIs and command identity checks remain authoritative.
+
+The API 5 artifact's hashes cannot identify API 6. Before wiring the replacement, establish an actual package/build identity and hosted runtime URL. Pass the exact build identity to the SDK handshake and retain it in chat session and snapshot metadata. A version label, local build success, or a temporary dependency path is insufficient evidence. Fresh chat data is permitted, so incompatible old experimental sessions do not need migration.
+
+Production needs a verified isolated host and preview origin in TanStack infrastructure. Do not remove the existing DEV/origin guard and continue to use the old broker. The API 6 HostedKernel declaration is available in the installed package, but hosted behavior, cleanup, snapshot compatibility and artifact distribution still require real verification.
+
+The sibling runtime work remains active. Current local package references are machine-specific and a recent sibling plain-HTML build probe fails. No approved deployment has been performed. This document records the concrete reuse path, it does not claim the host adaptation is implemented.
diff --git a/docs/tanchat-local-review.md b/docs/tanchat-local-review.md
new file mode 100644
index 000000000..dbc43b293
--- /dev/null
+++ b/docs/tanchat-local-review.md
@@ -0,0 +1,20 @@
+# Local review
+
+Open http://localhost:3001/chat.
+
+The current Vite process is listening on IPv6 localhost port 3001. Start a new session only after the existing process stops:
+
+```sh
+cd /Users/tannerlinsley/GitHub/tanstack.com
+PORT=3001 pnpm run dev:cloudflare
+```
+
+Use the normal Google or GitHub login. Existing provider, OAuth state, account and session checks remain enabled. Local environment configuration contains the database, session secrets, both provider credential pairs, and integration encryption key. Credential values were not printed. The included model is configured in wrangler.jsonc, not .env.local.
+
+The automated browser currently refuses this local URL with ERR_BLOCKED_BY_CLIENT. The running server alone does not prove the page or login works. Browser protections have not been changed. Real sign-in, model requests, connected integrations, browser code execution, and rendered UI still need verification.
+
+Deployment is on hold until approval after review. Do not deploy, publish remotely, merge a change that automatically deploys, or activate production traffic.
+
+## Install and offline review
+
+On /chat, verify the single manifest link points to /chat/manifest.webmanifest and browser install opens /chat. Other site routes must keep /site.webmanifest. In a production build, the chat worker registers /tanchat-sw.js with /chat scope. Test offline navigation at /chat and a nested conversation. Login and API requests must never receive an offline page, and no private responses may appear in Cache Storage. Browser installation and real offline navigation have not yet been verified.
diff --git a/docs/tanchat-performance-review.md b/docs/tanchat-performance-review.md
new file mode 100644
index 000000000..4d90b0848
--- /dev/null
+++ b/docs/tanchat-performance-review.md
@@ -0,0 +1,50 @@
+# TanChat final regression review
+
+Comparison against main at d653e768, October 1, 2026. The candidate is the draft PR checkout. No deployment or merge was performed.
+
+## Client bundle comparison
+
+Both production builds succeeded. Both used the same installed dependency tree and content collection, so this isolates source changes rather than comparing independent clean installs. The script reads each production route manifest and sums unique root and route preload assets plus CSS. Gzip sizes are compressed per file. These are preload sizes, not a browser network trace or Core Web Vitals measurement.
+
+| Route | Main gzip bytes | Candidate gzip bytes | Change |
+| ------------------- | --------------: | -------------------: | ------------: |
+| Root assets | 439,391 | 444,852 | +5,461, 1.24% |
+| Home | 457,429 | 462,923 | +5,494, 1.20% |
+| Documentation route | 441,939 | 447,402 | +5,463, 1.24% |
+| Chat workspace | Not present | 999,337 | New route |
+
+The first candidate loaded about 25 KB more compressed assets on ordinary site routes. Eager Zod validation in chat route definitions and shared OAuth completion was responsible for most of that increase. Chat navigation now uses the site's existing Valibot dependency, and popup completion loads its schema on demand. Origin, channel, expiration, cleanup, and server session verification checks remain intact.
+
+Total emitted client JavaScript increases from 18,361,230 to 19,832,029 bytes. This is all emitted chunks, including lazy chat features, not the amount fetched by every visitor. Chat itself still has a substantial initial preload budget and should receive a separate route-level performance pass.
+
+Reproduce after building both directories:
+
+```sh
+node scripts/chat/compare-route-bundles.mjs /path/to/main /path/to/candidate
+```
+
+## Review findings and fixes
+
+- Removed the obsolete local Start route augmentation. Its generic parameter declarations conflicted with the framework declaration and broke route search and loader inference across the site. The framework owns this type contract now.
+- Added explicit input types to nine generic navigation callbacks, with validation retained at the boundary.
+- Regenerated the route tree to include the existing shared-project route.
+- Removed tests for three retired Builder UI components. Kept the tests for retained activity parsing, reduction, sanitization, and durable compaction utilities.
+- Updated shared-auth runtime fixtures with OAuth account columns and explicit invite grants. Tests still reject revoked chat access before host routing, and separately reject access to another conversation.
+- Updated popup tests to wait for lazy schema loading before checking in-flight verification cancellation.
+
+## Limits
+
+The existing browser inspection timed out, and a fresh localhost navigation reported connection refused, so this review does not certify rendered parity, real OAuth login, touch gestures, production cold starts, or Core Web Vitals. The live localhost checkout is separate from the PR checkout used for these checks. A small shared bundle increase remains, so this is not a claim of zero performance impact.
+
+## Validation
+
+- Production build passed.
+- All five TypeScript configurations passed, without dependency downgrades or type suppression.
+- Lint passed with zero errors and 103 warnings.
+- Site unit tests: 537 passed, four skipped.
+- TanChat harness: all 2,221 tests passed in 226 files.
+- Electron source tests: all 20 passed.
+- Disposable PostgreSQL migration and foreign-key cascade checks passed.
+- PostgreSQL runtime: all 245 tests passed in 28 files after the fixture corrections. The earlier run affected by local disk exhaustion was discarded.
+
+The existing PR includes a separate PostgreSQL runtime CI job. CI and live account/browser checks still need to be reviewed before merge.
diff --git a/docs/tanchat-review-status.md b/docs/tanchat-review-status.md
new file mode 100644
index 000000000..dbb92f35a
--- /dev/null
+++ b/docs/tanchat-review-status.md
@@ -0,0 +1,26 @@
+# TanChat consolidation review status
+
+Local implementation is available in this checkout. Release remains held for human review. The full consolidation goal is not complete.
+
+| Requirement | Current evidence | Remaining verification |
+| ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| TanStack-owned backend and identity | Shared PostgreSQL repositories, AuthService and SessionService; native authorization and revocation runtime tests | Real account login and session behavior through the UI |
+| Complete harness at /chat | 603 files under src/chat; complete current local test gate | Feature-by-feature rendered parity and ordinary real tasks |
+| Replace the Builder harness | Route redirects and retired private API boundaries; dedicated shared example and chart paths retained | Real deep links, embeds and site navigation |
+| Preserve motion and touch | Original handlers retained and wired; motion CSS emitted; gesture fixture checks | Reported animation regression and actual touch-device behavior |
+| Preserve streams, copies, retries and context | 245 PostgreSQL/runtime tests; original copy benchmarks retained | Live reconnect, long-history tails and copy latency |
+| Shared site remains intact | Site tests; chat stylesheet scoping; actual startup and cleanup appearance checks | Real navigation into and out of chat |
+| Chat local execution bridge | Original broker bridge and ownership contract retained; source restricts bridge to DEV at http://127.0.0.1:3002 and broker at port 4320 | Provide a verified compatible broker/runtime and wire the actual TanStack execution path; localhost:3001 and production currently cannot use this bridge |
+| Models, integrations, files, workflows and schedules | Ported source and contract/runtime checks | Real configured model, MCP account, workflow, schedule and saved-file tasks |
+| TanStack Cloudflare ownership | Local bindings and worker configuration; draft secret work recorded in consolidation history | Deploy approved revision, verify resources and usage attribution |
+| chat.tanstack.com alias | Safe canonical redirect handler and navigation tests | DNS activation and real HTTP redirect verification |
+| TanStack Electron | Original native host, device/folder/update code and release scripts retained; 20 local tests | Native account flow, notarized distributable and hosted updates if shipping |
+| Reproducible installation | Current machine build passes | Replace sibling-owned temporary browser-sandbox package references before clean CI installation |
+| Operational scripts | Every original script listed in tanchat-script-port-inventory.json | Resolve missing live diagnostics, smoke tests and research script dispositions |
+| Release | No release performed | Human review approval, deployment, deployed revision verification and cutover |
+
+The current combined local gate is /private/tmp/tanchat-consolidation-current-full-gate.log: five TypeScript checks pass, lint reports 106 warnings and zero errors, 508 site tests pass with two skipped, 2,208 harness tests pass in 224 files, and 20 Electron tests pass. The last separate PostgreSQL runtime result is /private/tmp/tanchat-runtime-all-original-files.log: 245 tests in 28 files.
+
+Browser inspection of the local application was rejected by the browser tool's access policy. No alternate access path was used. Static source and fixture results do not close that verification gap.
+
+See tanchat-consolidation.md for implementation history and evidence limits. Existing unrelated sibling work is preserved. No old account data is being migrated, and the old deployment is retained until replacement verification and approved cutover.
diff --git a/docs/tanchat-runtime-test-coverage.json b/docs/tanchat-runtime-test-coverage.json
new file mode 100644
index 000000000..230dc390b
--- /dev/null
+++ b/docs/tanchat-runtime-test-coverage.json
@@ -0,0 +1,217 @@
+{
+ "note": "File presence is not execution evidence. Test adaptations and validation results are recorded in tanchat-consolidation.md.",
+ "tests": [
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/assistant-conversation-tools.test.ts",
+ "sourceSha256": "cc7e1074f684219a0097b80356219b010318eb3b95690ca2f002c4a46210f115",
+ "destination": [
+ "harness-tests/pending-runtime/assistant-conversation-tools.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/assistant-discovery-runtime.test.ts",
+ "sourceSha256": "fe2a99b23a91eff5e7ea842b6a97e61a279ea9cde5a75e5bf6af695ea53cdcf8",
+ "destination": [
+ "harness-tests/pending-runtime/assistant-discovery-runtime.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/context-reference-paging-runtime.test.ts",
+ "sourceSha256": "e1f0b569e217845204160c3afd591b014b820dbbfaf4d763a4bd95b456cf32ca",
+ "destination": [
+ "harness-tests/pending-runtime/context-reference-paging-runtime.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-discovery-runtime.test.ts",
+ "sourceSha256": "30644f98452416cfc7f4efd4f0462bcf751d27df68b8b574c0757a39df1a764d",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-discovery-runtime.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-execution.test.ts",
+ "sourceSha256": "63601d6de6345440035880e76e2fb8425c7c89d98da6349c935bea0b4b07baf0",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-execution.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-file-copy.test.ts",
+ "sourceSha256": "111cbac7e5cd5f6202ae0b5f737533b72050c5a68e2371476ffbc58ff6c33b9e",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-file-copy.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-kody-memory-review.test.ts",
+ "sourceSha256": "862c947ffc6a02be57d82fe31a6a5d8abb216198e17231b58544947c3cfc50d7",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-kody-memory-review.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-progress.test.ts",
+ "sourceSha256": "40d28322db4b3f50a7e9c6ca5717237e1fe43f29272ae491e885d28e1946d1bc",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-progress.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-provider-attempts.test.ts",
+ "sourceSha256": "d621de4d6d58ee50b424bcaba4ddd24df89267194fd84b0e9d15cd71cc099818",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-provider-attempts.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-response-preferences.test.ts",
+ "sourceSha256": "22e4c41bd8a0a1a42f9c280c45a79565d0f3f7d76860a8c1024454e3a279404f",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-response-preferences.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-run-continuation.test.ts",
+ "sourceSha256": "96c18babfa27d60e9c0e658df744d6ea0f22f378185e5a19da2596f8b3832652",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-run-continuation.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-runs-runtime.test.ts",
+ "sourceSha256": "61fd39a0f2f8e26515ac054ece8cfd5b2bdb2dab516f90400f5ee75a2074c93a",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-runs-runtime.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-runs-system-one.test.ts",
+ "sourceSha256": "8dd4a9b55d89aed74aab68033ac10bcb47933bd0898ad93321f4ad377e2ff9a1",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-runs-system-one.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-schedule-continuation.test.ts",
+ "sourceSha256": "f7175b30b0569de2537124d8719eb60f66a622c09c8a4fb838a400a2742de90e",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-schedule-continuation.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-schedule-lifecycle.test.ts",
+ "sourceSha256": "9bfde11ec8962b4776edcfcf7a6e6e562d5852fcdc9e0c6881473f15d6477111",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-schedule-lifecycle.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-schedule-review.test.ts",
+ "sourceSha256": "51b5f935cbd863540e43afe3633f16a2ebd6d2cdad75201b086c35220be6f78b",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-schedule-review.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-schedules-runtime.test.ts",
+ "sourceSha256": "ef3dd903748fb67a4b52bb8d8811df1b15e2d2521c18b610f2678c94cb397bc3",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-schedules-runtime.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-tool-failures.test.ts",
+ "sourceSha256": "2337000e57a6ed64d5b302cfbb27da201727e747dfc91f1835ad0e18c0f4f9aa",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-tool-failures.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/conversation-workspace-review.test.ts",
+ "sourceSha256": "a601c8c8850be3615cec2e618ba7601f61afc49408ff00bd64b4e90e06032da2",
+ "destination": [
+ "harness-tests/pending-runtime/conversation-workspace-review.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/execution-project-snapshots.test.ts",
+ "sourceSha256": "da98edf83536e9d0ac488e41dd9577406ad7a5e5c96e29c3c32fc65c1215012f",
+ "destination": [
+ "harness-tests/pending-runtime/execution-project-snapshots.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/memory-runtime.test.ts",
+ "sourceSha256": "c410d4c5654f5a3dc9c0147ee66c5d0085677a922354bbd6bcf25025ce7388ac",
+ "destination": ["harness-tests/pending-runtime/memory-runtime.test.ts"],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/plugin-reference-runtime.test.ts",
+ "sourceSha256": "4d78c22597bfbc086e6ac87bc5028757b80075c94281d160ab2f8142bad8b8d0",
+ "destination": [
+ "harness-tests/pending-runtime/plugin-reference-runtime.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/reference-cursor-contract.test.ts",
+ "sourceSha256": "d517ff62fecfeec1f1c950bdd268f2e4bdbeb1eaa83ae146e641d7f256258ff3",
+ "destination": [
+ "harness-tests/pending-runtime/reference-cursor-contract.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/retry-attempt-runtime.test.ts",
+ "sourceSha256": "7dea3f562f81a221df39b66525b954cde2ca8fcc861de29e086e00058368dff9",
+ "destination": [
+ "harness-tests/pending-runtime/retry-attempt-runtime.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/retry-source-runtime.test.ts",
+ "sourceSha256": "0e7684fa7ac02b0317d74f09fee91cc6a17adb8df627dbfe82f8a28e7f2eb26d",
+ "destination": [
+ "harness-tests/pending-runtime/retry-source-runtime.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/transcript-navigation-runtime.test.ts",
+ "sourceSha256": "6ceb6590e5b3dabc59dc2ff5f296f06128f7633293e3e36026c2dd83f3b9fa85",
+ "destination": [
+ "harness-tests/pending-runtime/transcript-navigation-runtime.test.ts"
+ ],
+ "status": "present"
+ },
+ {
+ "source": "/Users/tannerlinsley/GitHub/gum/tests/workflow-runtime.test.ts",
+ "sourceSha256": "d15b7e1f61badd9b67a0672af64282779ac70cebb662c454b0733a93bdee08a8",
+ "destination": ["harness-tests/pending-runtime/workflow-runtime.test.ts"],
+ "status": "present"
+ }
+ ]
+}
diff --git a/docs/tanchat-script-port-inventory.json b/docs/tanchat-script-port-inventory.json
new file mode 100644
index 000000000..125e2dbcf
--- /dev/null
+++ b/docs/tanchat-script-port-inventory.json
@@ -0,0 +1,470 @@
+{
+ "scope": "Original scripts only. Presence does not prove behavior or completeness.",
+ "scripts": [
+ {
+ "source": "scripts/analyze-ranking-confidence.py",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/audit-task-baselines.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/benchmark-conversation-copy.ts",
+ "destination": "scripts/chat/benchmark-conversation-copy.ts",
+ "status": "present, adaptation review required"
+ },
+ {
+ "source": "scripts/benchmark-conversation-protocol.ts",
+ "destination": "scripts/chat/benchmark-conversation-protocol.ts",
+ "status": "present, adaptation review required"
+ },
+ {
+ "source": "scripts/check-mcp-egress.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/compare-ranking-prompts.py",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/desktop-publish.mjs",
+ "destination": "scripts/desktop-publish.mjs",
+ "status": "present, adaptation review required"
+ },
+ {
+ "source": "scripts/desktop-release.mjs",
+ "destination": "scripts/desktop-release.mjs",
+ "status": "present, adaptation review required"
+ },
+ {
+ "source": "scripts/diagnose-kimi-transport.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/diagnose-multiline-provider.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-alpha-report.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-answer-evidence.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-array-workflow.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-assistant-baseline.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-assistant-instructions.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-batched-ranking.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-branching-discovery.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-call-review.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-code-refactor.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-dynamic-mcp.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-evidence-freshness.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-file-copy.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-grounding-review.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-history-recovery.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-included.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-jev-arguments.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-kody-code-discovery.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-mcp-session.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-mcp-tasks.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-message-attachments.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-message-references.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-multi-server-workflow.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-project-maintenance.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-ranking-evidence.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-ranking-recovery.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-ranking-suite.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-response-preferences.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-result-context.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-retry-runtime.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-retry-uncertain.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-run-model.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-saved-files.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-schedule-runtime.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-schedule-timezone.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-schedules.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-server-selection.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-shortlist-selection.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-stored-records.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-system-one-context.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-system-one-tasks.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-terminal-classification.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-tool-ranking.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-tool-selection.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-verification-audit.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-verification-recovery.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/evaluate-workflow-runtime.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/fixtures/browser-sandbox-pin.json",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/lib/kimi-transport-diagnostic.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/lib/message-attachments-evaluation.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/lib/saved-files-evaluation.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/lib/schedule-evaluation.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/local-mcp-egress.ts",
+ "destination": "scripts/local-mcp-egress.ts",
+ "status": "present, adaptation review required"
+ },
+ {
+ "source": "scripts/observe-schedule-review.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/observe-sketch-runtime.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/record-delegation-evaluation.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/reference-paging-evidence.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/rehearse-alpha-migrations.py",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-attachments.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-branching.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-conversation-identity.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-conversation-references.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-conversation-threads.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-conversation.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-drafts.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-exclusive-fork.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-files.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-onboarding.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-references.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-remote-fixture.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-retry-attempt.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-retry-chain.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-retry-files.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-retry-source.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-retry-uncertain.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-review-fixture.ts",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-run-models.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-runs.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-schedule-recovery.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-schedules.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-skills.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-workspace-sync.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke-workspace.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ },
+ {
+ "source": "scripts/smoke.mjs",
+ "destination": null,
+ "status": "not ported, disposition required"
+ }
+ ]
+}
diff --git a/docs/tanchat-server-port.json b/docs/tanchat-server-port.json
new file mode 100644
index 000000000..fa8efeaf9
--- /dev/null
+++ b/docs/tanchat-server-port.json
@@ -0,0 +1,2095 @@
+[
+ {
+ "source": "migrations/0004_bot_workspace.sql",
+ "destination": "drizzle/migrations/0034_tanchat_parent_guards.sql",
+ "sourceSha256": "f89c1a930b361afa2dbe5d4cb55a73077e5ba5837eda5062ec8797d1d9461390",
+ "destinationSha256": "f7b75380a984d6e9a385a8b25670ea9e76d33d369663de072891396c034d7780",
+ "unchanged": false,
+ "sourceSection": "bots_parent_insert, bots_parent_update"
+ },
+ {
+ "source": "src/server.ts",
+ "destination": "src/server.ts",
+ "sourceSha256": "bc496fe7c294f4106a9749d6f1e4ea40b2ed147b6adc7b7175d8636c01562a5a",
+ "destinationSha256": "9cad65182a4b70e59168c9d2a8b8851a59fe6cd9d37eaeaa1f2790ecc1a599a6",
+ "unchanged": false,
+ "sourceSection": "StreamObject and WorkspaceSync named Worker exports"
+ },
+ {
+ "source": "src/server/account-preferences.ts",
+ "destination": "src/chat/server/account-preferences.ts",
+ "sourceSha256": "946a6a2223bb67235458aed2b937a178f16ae36cfab0dba4bab3880815629bea",
+ "destinationSha256": "bce22f23a4ca5d1167bee461f13192c3b60920dd7b3f63b1f1f11fe979faaf4d",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/answer-evidence.ts",
+ "destination": "src/chat/server/answer-evidence.ts",
+ "sourceSha256": "88bedd06eef0bc4a438af9cbf75c1a7a334f3ea16da3feebbbe3c46474a6cd25",
+ "destinationSha256": "58a03cb2a04a2fe1e1fd957e7eb4bff816f4ba150fd18291556bff25032f1097",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/bootstrap-workspace-data.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "22b79ff22daf5628d7a3baf3721ff7b329b5514f4adf4a14b77448c05005fb37",
+ "unchanged": false,
+ "sourceSection": "bootstrap workspace/bots/sections/activity/recipes/membership list reads, native PostgreSQL adaptation; original workspaceActivity serialization"
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/bootstrap.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "0f638fed06bbfa9c4f84e2d30aed66c179d852d0f192c97e14f41da9f5b89f40",
+ "unchanged": false,
+ "sourceSection": "complete bootstrap response composition, native PostgreSQL and shared TanStack identity adaptation"
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/conversation-control-api.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "203c49349cd91b9196a68aa17856e963d467f71e166c0c344a151be5620f59ab",
+ "unchanged": false,
+ "sourceSection": "stop, queue, lifecycle rejection, reset, dismiss-task, continue-task and approval branches; server context loading injected"
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/conversation-read-api.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "d4ef4951a12133d4a7490180197d8edee4ff817a393c20b779171881ee9248dd",
+ "unchanged": false,
+ "sourceSection": "history and stream operation branches, unchanged bodies; caller authorization remains required"
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/conversation-send-api.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "41a4c0639a15d8381ba599919b7aa20d8f60e6dfb7a37a52c0878e90cb05a9aa",
+ "unchanged": false,
+ "sourceSection": "message submission schema, begin call and result status mapping, unchanged bodies; server context and authorization supplied by caller"
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/saved-actions.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "fe52a9f287e58f5c0d69871843b18649becaaba998ce7d68dbe7950aeaa0f3bb",
+ "unchanged": false,
+ "sourceSection": "recipes POST/DELETE and workspace recipe listing; conversation.ts retains 30-row run bound"
+ },
+ {
+ "source": "src/server/assistant-capability-guidance.ts",
+ "destination": "src/chat/server/assistant-capability-guidance.ts",
+ "sourceSha256": "f0bc851325e7cff6c462365c8db8a8451cb4cf37c3a6ddb8adbc6a1501223778",
+ "destinationSha256": "f0bc851325e7cff6c462365c8db8a8451cb4cf37c3a6ddb8adbc6a1501223778",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-connection-tools.ts",
+ "destination": "src/chat/server/assistant-connection-tools.ts",
+ "sourceSha256": "87b0bfa3126c900aa6036677d3d12b606715b37c4ed28fb64a6e1d3817ebd10d",
+ "destinationSha256": "87b0bfa3126c900aa6036677d3d12b606715b37c4ed28fb64a6e1d3817ebd10d",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-context.ts",
+ "destination": "src/chat/server/assistant-context.ts",
+ "sourceSha256": "3f7309866029bf20002adf10651dc52f1bdab1b7e8a57da3bb1477ab33f6dbe0",
+ "destinationSha256": "3f7309866029bf20002adf10651dc52f1bdab1b7e8a57da3bb1477ab33f6dbe0",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-conversation-tools.ts",
+ "destination": "src/chat/server/assistant-conversation-tools.ts",
+ "sourceSha256": "b48b450bcb43b56289ec99fe378f96dee044df2d92be72141a7be7e57dd90f30",
+ "destinationSha256": "522878d49b3c2422b4371f772b4060687077cb5d62e75dd9ea0b1294d7f371df",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/assistant-delegation-tools.ts",
+ "destination": "src/chat/server/assistant-delegation-tools.ts",
+ "sourceSha256": "09e299bf2504938e39aba9079db792dd35b8a8046c162a90fffa376e686af7f4",
+ "destinationSha256": "09e299bf2504938e39aba9079db792dd35b8a8046c162a90fffa376e686af7f4",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-discovery.ts",
+ "destination": "src/chat/server/assistant-discovery.ts",
+ "sourceSha256": "a0dc605518caa5fcb8370466a99260dfe0f0afc473195d5075b67f96ca2d7d96",
+ "destinationSha256": "a0dc605518caa5fcb8370466a99260dfe0f0afc473195d5075b67f96ca2d7d96",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-file-tools.ts",
+ "destination": "src/chat/server/assistant-file-tools.ts",
+ "sourceSha256": "9b29699b95952fb50482d3d96bb9d3278a0dbcb166cb5844c506c90d956b8639",
+ "destinationSha256": "9b29699b95952fb50482d3d96bb9d3278a0dbcb166cb5844c506c90d956b8639",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-instructions.ts",
+ "destination": "src/chat/server/assistant-instructions.ts",
+ "sourceSha256": "d67017671c4da99283743b4fa1ce820340b1ad8fefd7206deffbab4cc0086fb1",
+ "destinationSha256": "e8fa20923f91f6834bbea208aa552e204ebadf96891b43cd905ac6698741b575",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/assistant-kody-memory-tools.ts",
+ "destination": "src/chat/server/assistant-kody-memory-tools.ts",
+ "sourceSha256": "ba43d469d58ef5e5a0c58b65d03f4c3ec0d052eb0b1162b3129c2b4935b8382c",
+ "destinationSha256": "8cc12850738fd48548188bfa1474e5f2955709000a0841c94a94e22e5e71ed15",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/assistant-kody-run-tools.ts",
+ "destination": "src/chat/server/assistant-kody-run-tools.ts",
+ "sourceSha256": "ff46f255bf4f0a2d574572c70ad645ec091c1fde3ed1022ebecbeffeb0bdb481",
+ "destinationSha256": "6177a03e95a21807588805d232b9b987d970625a82760b8ab72fc717d7b35516",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/assistant-mcp-tools.ts",
+ "destination": "src/chat/server/assistant-mcp-tools.ts",
+ "sourceSha256": "ec66f65b929737b3f24125cdc8ba492e2a25f3c05992c7f9a0bd4740138444e1",
+ "destinationSha256": "ec66f65b929737b3f24125cdc8ba492e2a25f3c05992c7f9a0bd4740138444e1",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-memory-tools.ts",
+ "destination": "src/chat/server/assistant-memory-tools.ts",
+ "sourceSha256": "832f96f8f23fd0077d860032b2126c3685002fbb1cb4b5bb098ca887872c34c5",
+ "destinationSha256": "1ef3070ede35913ea1b1c6afe43b55469a942ea8c282afb4b5a234f753c01894",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/assistant-message-history.ts",
+ "destination": "src/chat/server/assistant-message-history.ts",
+ "sourceSha256": "3b6285378f1ce4c6f275b1364ee9dc820cc1d0ab3579eb7ad849e34a6be91be8",
+ "destinationSha256": "3b6285378f1ce4c6f275b1364ee9dc820cc1d0ab3579eb7ad849e34a6be91be8",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-plugin-tools.ts",
+ "destination": "src/chat/server/assistant-plugin-tools.ts",
+ "sourceSha256": "7900972908a5177eac71ca7e57b204696266de749f0269ecadc96811c538379f",
+ "destinationSha256": "9be055a4f853db30a6c101b75e99d5e8b5984e0005682a6c76c5933db7db59dc",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/assistant-progress.ts",
+ "destination": "src/chat/server/assistant-progress.ts",
+ "sourceSha256": "52c469e959f8b01bce61502ab8e5315870144bbbb8820b2b50a85f4025c86046",
+ "destinationSha256": "52c469e959f8b01bce61502ab8e5315870144bbbb8820b2b50a85f4025c86046",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-schedule-policy.ts",
+ "destination": "src/chat/server/assistant-schedule-policy.ts",
+ "sourceSha256": "7e387ecb7fabd4deda0760645eb336576901410e06742196b4b5d5046d8eb066",
+ "destinationSha256": "7e387ecb7fabd4deda0760645eb336576901410e06742196b4b5d5046d8eb066",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-schedule-tools.ts",
+ "destination": "src/chat/server/assistant-schedule-tools.ts",
+ "sourceSha256": "f724841b1a8664550bb8b8558ae9ff6c3237f31202b7063d0ea5211634a194cf",
+ "destinationSha256": "f724841b1a8664550bb8b8558ae9ff6c3237f31202b7063d0ea5211634a194cf",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-skill-tools.ts",
+ "destination": "src/chat/server/assistant-skill-tools.ts",
+ "sourceSha256": "58770fe09f184f2483ea468a7621340fca438c3bfd9d40cc97a447c54782d943",
+ "destinationSha256": "0e50175338f2bc35b69867d3c2ef601af222cc5a3c03bb990d366b5457848a8e",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/assistant-thread-tools.ts",
+ "destination": "src/chat/server/assistant-thread-tools.ts",
+ "sourceSha256": "bd5729432560512fecfd08f84a8b7bddae26659d230b8fb65fe8ae77626e8a0c",
+ "destinationSha256": "2392bad16980f9842a332bb9ed05cdb327257c8710e8e21cd5ca893c18c6ecf7",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/assistant-tool-failures.ts",
+ "destination": "src/chat/server/assistant-tool-failures.ts",
+ "sourceSha256": "fdd2626cecd87ab1a77e625f20a795b8471cdcee82452c351379409029df8f26",
+ "destinationSha256": "fdd2626cecd87ab1a77e625f20a795b8471cdcee82452c351379409029df8f26",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/assistant-workflow-tools.ts",
+ "destination": "src/chat/server/assistant-workflow-tools.ts",
+ "sourceSha256": "313a4b7888b835b17ca88662eef39a15643a6ee602ccfb96f0918b6a7a385824",
+ "destinationSha256": "06bfd4c4df108aa5a0871acc9c6f6d22e6d8cf95d6487999cf16f6879891c816",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/assistant-workspace-tools.ts",
+ "destination": "src/chat/server/assistant-workspace-tools.ts",
+ "sourceSha256": "19ac60ed9310394b8b4ecb6175009215d2c7db83fb9b3f795ec63a9ade0ba8d6",
+ "destinationSha256": "19ac60ed9310394b8b4ecb6175009215d2c7db83fb9b3f795ec63a9ade0ba8d6",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/attachment-request.ts",
+ "destination": "src/chat/server/attachment-request.ts",
+ "sourceSha256": "41595f455016fb9450efaa2a6e3afc81e55e26cea87dabedb0bf6481b56f6a27",
+ "destinationSha256": "a822b72add1aebbb3380f9e834df23e3c2dbba93a0738809d558ea0838856b19",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/batched-ranking.ts",
+ "destination": "src/chat/server/batched-ranking.ts",
+ "sourceSha256": "aadf3ef39642889ae37f2e0abdd54f636cf8bbc121199a8487a1f8a7520971ee",
+ "destinationSha256": "487da97f4fe2e399ab5f41b6e8e90541fb50b6486832dd73a30ce5f86ed6cfb7",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/batched-values.ts",
+ "destination": "src/chat/server/batched-values.ts",
+ "sourceSha256": "a8661521828210dcc07d6c5a219c898c5ccd2e6d5e00a549f31edb8983cc0ed3",
+ "destinationSha256": "365d8296a6d8f7f0be9a1df20f0733aa3986df87653565f76dd9b23c69a7b3bc",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/bot-activity.ts",
+ "destination": "src/chat/server/bot-activity.ts",
+ "sourceSha256": "0c73be4dc3fd02d34f9cb294929e8ef4ae6368e7863d25a90011e9408651d2c8",
+ "destinationSha256": "fd0a8376d6fc62c0827ac744cccb888469124a4be346a7038279746bb90ec3c4",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/bot-drafts.ts",
+ "destination": "src/chat/server/bot-drafts.ts",
+ "sourceSha256": "68160fcf9f7c522828ff5923959a30898921ec17cf684050d3e511a15f88ac9e",
+ "destinationSha256": "932439184f5f16a3deb7a1a1fcb161215a8a9b9db157e49d64cc4a5ecec102a2",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/bot-workspace.ts",
+ "sourceSection": "readWorkspaceBots, readBotSections, BotWorkspace.get",
+ "destination": "src/chat/server/bot-workspace-reads.ts",
+ "sourceSha256": "3ae848924e558d8eac7cb113296dfe6f568a2b75778fc5df988b2f83aded8db2",
+ "destinationSha256": "749a024373332cb0f52ce0b6aa1ae9ba0ddcfa03bd6b37ee7e9ad4fae25ef499",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/bot-workspace.ts",
+ "destination": "src/chat/server/bot-workspace.ts",
+ "sourceSha256": "3ae848924e558d8eac7cb113296dfe6f568a2b75778fc5df988b2f83aded8db2",
+ "destinationSha256": "dc2f5441b1de073331efedb8994ab7745fff34e9857920ef5e89d33170b4812e",
+ "unchanged": false,
+ "sourceSection": "BotWorkspace.get, checkVersion, available, parent, authorize, create, patch, applyHistory, organize, reorderBots, subtree, snapshotGuard, activeAncestor, delete, restore, move, moveGroup; source section commands reused through WorkspaceSections"
+ },
+ {
+ "source": "src/server/bot-workspace.ts",
+ "sourceSection": "BotWorkspaceError class",
+ "destination": "src/chat/server/workspace-error.ts",
+ "sourceSha256": "3ae848924e558d8eac7cb113296dfe6f568a2b75778fc5df988b2f83aded8db2",
+ "destinationSha256": "983557af317e5af36ad04f617e4d58de89e297f9aa56d1e1f461c4e67852d40c",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/bot-workspace.ts",
+ "destination": "src/chat/server/workspace-lifecycle-reservation.ts",
+ "sourceSha256": "3ae848924e558d8eac7cb113296dfe6f568a2b75778fc5df988b2f83aded8db2",
+ "destinationSha256": "d9b884a111a45e2caeb3ee33754d848bab51b37d9c8fe45a2dade46a93823533",
+ "unchanged": false,
+ "sourceSection": "BotWorkspace.reserve"
+ },
+ {
+ "source": "src/server/bot-workspace.ts",
+ "sourceSection": "createSection, setSections, removeEmptySections, patchSection and deleteSection, native PostgreSQL transaction adaptation",
+ "destination": "src/chat/server/workspace-sections.ts",
+ "sourceSha256": "3ae848924e558d8eac7cb113296dfe6f568a2b75778fc5df988b2f83aded8db2",
+ "destinationSha256": "2eb659b23b948a0e1a304e997db725f8381b31da15f1f44f268f285c12cac12f",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/browser-execution.ts",
+ "destination": "src/chat/server/browser-execution.ts",
+ "sourceSha256": "cc41190efa89446459a5b01fd97fd81c598c2df5977b262721449b557d0cfb22",
+ "destinationSha256": "7943dbe14892315eb0cad2591b9300c022f51c8d895f00d901c0f425de695e8f",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/catalog-evidence.ts",
+ "destination": "src/chat/server/catalog-evidence.ts",
+ "sourceSha256": "506afb02048c2f000a4a8eb7f73d35c4ffc7cbd5825cd5a5b0171e2f58b90dba",
+ "destinationSha256": "506afb02048c2f000a4a8eb7f73d35c4ffc7cbd5825cd5a5b0171e2f58b90dba",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/cloudflare-text.ts",
+ "destination": "src/chat/server/cloudflare-text.ts",
+ "sourceSha256": "3238bb9da3176a64c30edc8425a6f869c1556ff8d46503050a0bab85f4f60e91",
+ "destinationSha256": "3238bb9da3176a64c30edc8425a6f869c1556ff8d46503050a0bab85f4f60e91",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/composer-drafts.ts",
+ "destination": "src/chat/server/composer-drafts.ts",
+ "sourceSha256": "a8853f2ebb93a422c580e8794f641933df597f30065d3ecb95a26ffde5979b3e",
+ "destinationSha256": "cd76a66eff7fcd65519a4360645511e4fac38ec4e97893009fc0198806a696e4",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/connected-devices.ts",
+ "destination": "src/chat/server/connected-devices.ts",
+ "sourceSha256": "59e1c63b76f2d6469a4288bc1ddb006c42d260aea9064cfece3d34d389f39173",
+ "destinationSha256": "b3abff79331a51d9484ee8cd4f256ed24421782063247402e764125cccb0edd9",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/conversation-copies.ts",
+ "sourceSection": "ConversationCopies admission, status and source provenance service",
+ "destination": "src/chat/server/conversation-copies.ts",
+ "sourceSha256": "1b97f074e26e84a26df1897d05b3780a1f23fd582fc35c72970a1d3000cf967a",
+ "destinationSha256": "6899ada9dd552d9477f0f32ea26720bf185406cf94c29131672c4baf49cf491c",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/conversation-copies.ts",
+ "sourceSection": "CopyFailure through CopyOperationView, RPC interfaces",
+ "destination": "src/chat/server/conversation-copy-contract.ts",
+ "sourceSha256": "1b97f074e26e84a26df1897d05b3780a1f23fd582fc35c72970a1d3000cf967a",
+ "destinationSha256": "eac51c99d2f138528e0fefcfc604e88787ea8c0a7723782b8f956ee8af0eb9ae",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/conversation-copies.ts",
+ "sourceSection": "updateOperation through resumeConversationCopies, original worker and authority helpers",
+ "destination": "src/chat/server/conversation-copy-worker.ts",
+ "sourceSha256": "1b97f074e26e84a26df1897d05b3780a1f23fd582fc35c72970a1d3000cf967a",
+ "destinationSha256": "8fff7779bc5a56f9bde9112da723b039b4eb6756c422e6785244897fc1e85e64",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/conversation-copy-storage.ts",
+ "destination": "src/chat/server/conversation-copy-storage.ts",
+ "sourceSha256": "f253e32498c0d4bf96eba33d5a22fc6b9a6506404bbf9f2ee73eb096a6483d4f",
+ "destinationSha256": "e3a771e71c3b1fa124f2defea9860cea8f3dd829bf6295b98e943ceae248b89b",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/conversation-events.ts",
+ "destination": "src/chat/server/conversation-events.ts",
+ "sourceSha256": "b5d62937c95d476d065e2f21927f7ea88297a770baf02f3c05223e6c1b4a30eb",
+ "destinationSha256": "b5d62937c95d476d065e2f21927f7ea88297a770baf02f3c05223e6c1b4a30eb",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/conversation-retries.ts",
+ "destination": "src/chat/server/conversation-retries.ts",
+ "sourceSha256": "61963fa5602a20e607ac0148d5c1860e738b40753545bd9c12af0c0c934779f5",
+ "destinationSha256": "5b5718dc25543d72602b1025aba5db0c0de059ddf9b6694114085dea37850b71",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/conversation-retries.ts",
+ "sourceSection": "ConversationRetryRow and copyRetrySource immutable review verifier",
+ "destination": "src/chat/server/copy-retry-source.ts",
+ "sourceSha256": "61963fa5602a20e607ac0148d5c1860e738b40753545bd9c12af0c0c934779f5",
+ "destinationSha256": "17ae1eca75c8bf76c37ad4ceb256a287a41e6e334c45825ac90622d0d7785854",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/conversation-run-projection.ts",
+ "destination": "src/chat/server/conversation-run-projection.ts",
+ "sourceSha256": "9568ec56c30da805dd56bb9ad9340e8390a577e0ec26535a0f5e46cae7466808",
+ "destinationSha256": "9568ec56c30da805dd56bb9ad9340e8390a577e0ec26535a0f5e46cae7466808",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/conversation-runs.ts",
+ "destination": "src/chat/server/conversation-runs.ts",
+ "sourceSha256": "257c72c6e8edf4a50859314316141908a9a08dc7e25c63cd1bc99ba8f793cafc",
+ "destinationSha256": "759459679e1769d50486292bb594adb2c55c7d9ad750b99fa0a5e056f0738972",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/conversation-stream.ts",
+ "destination": "src/chat/server/conversation-stream.ts",
+ "sourceSha256": "2621e87122946c235170facfae9c13db332414e28535385bb01c610d260afa9b",
+ "destinationSha256": "919ec8fe21e3053bee6a68fc8f7bca9cfd4e2788716dea9a9886de216ebbc5eb",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/conversation-threads.ts",
+ "destination": "src/chat/server/conversation-threads.ts",
+ "sourceSha256": "0bc23acced6315bf60bcfec875bc437255c12ebb1d1db642bcec8d1ec084e4bf",
+ "destinationSha256": "1761869910e129bbc056e5091b7cba425a1104ad4e888db33591858fe6a13c74",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/conversation.ts",
+ "destination": "src/chat/server/conversation-database.ts",
+ "sourceSha256": "f7236d21002472cc1a6f28e681dfbd573247eafd99cd71b7ac794a48d3a58dce",
+ "destinationSha256": "19a3d4595342bbfd58ac1b5cf3ab1b84ee1d811487a9f617a2fe408b10ecfbd4",
+ "unchanged": false,
+ "sourceSection": "guardActive lifecycle/retry queries; delegationContext, scheduleContext and queued run context reads; activateCopyImport activity/read publication checks; discardCopyImport publication check; workflow result child publication check; router Kody username hint; final run usage receipt start"
+ },
+ {
+ "source": "src/server/conversation.ts",
+ "destination": "src/chat/server/conversation.ts",
+ "sourceSha256": "f7236d21002472cc1a6f28e681dfbd573247eafd99cd71b7ac794a48d3a58dce",
+ "destinationSha256": "29c59572580d5ef9339a45c9b585b0d8d4330045f440a2772e6715646bed6b08",
+ "unchanged": false,
+ "status": "in_progress"
+ },
+ {
+ "source": "src/server/crypto.ts",
+ "destination": "src/chat/server/crypto.ts",
+ "sourceSha256": "b96b8f41e5dacd2ec1f63dcb1a4509c4f63b394a8015ca19e4ab85088b3905a4",
+ "destinationSha256": "b96b8f41e5dacd2ec1f63dcb1a4509c4f63b394a8015ca19e4ab85088b3905a4",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/delegation-admissions.ts",
+ "destination": "src/chat/server/delegation-admissions.ts",
+ "sourceSha256": "b4d7d57154995b17617dc9b9eae0a89f2ad62da1203090af849fc194c074dee8",
+ "destinationSha256": "f480396f30ddcf7409550e2c1c8b2f74f8eb4a85d4a81b5761292af6d91f1470",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/delegation-budget.ts",
+ "destination": "src/chat/server/delegation-budget.ts",
+ "sourceSha256": "08a4e6be93826712d1fced55709fe0469789c1ccff905f17bb80ee662ebc3fb4",
+ "destinationSha256": "8d46b56b22866d96aedad876b71cf5cf027be7339dab7c5ed874febaf5ef76bc",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/delegation-waits.ts",
+ "destination": "src/chat/server/delegation-waits.ts",
+ "sourceSha256": "91e2a7a57be7905ebbcba860b27c82869224ec45ab153b17071b6df79420ce7b",
+ "destinationSha256": "01e8dad5f43821c228ce729cbd7cb2857efee7081a95490f6edc4d481165990f",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/delegations.ts",
+ "destination": "src/chat/server/delegations.ts",
+ "sourceSha256": "2e1c19385d2dc1cad941a618418855984c35fa0c0bfb4ba23df819040d53cc79",
+ "destinationSha256": "6245b63a8c778e2fa06e3370b45474f6049aeb205763898c1da131115d97e887",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/development.ts",
+ "destination": "src/chat/server/development.ts",
+ "sourceSha256": "11071aca5a7fafd0778141773f285d3897581b74c6b60c2f885e818e9fd78a7b",
+ "destinationSha256": "11071aca5a7fafd0778141773f285d3897581b74c6b60c2f885e818e9fd78a7b",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/discovery-integrations/contract.ts",
+ "destination": "src/chat/server/discovery-integrations/contract.ts",
+ "sourceSha256": "d1f9081d2fc4c4be67960c3df93b90edd31b61e2a72f25d8d49f3bcb50b6d513",
+ "destinationSha256": "d1f9081d2fc4c4be67960c3df93b90edd31b61e2a72f25d8d49f3bcb50b6d513",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/discovery-integrations/index.ts",
+ "destination": "src/chat/server/discovery-integrations/index.ts",
+ "sourceSha256": "56e029b0d481114ddc5ea1034fd30d292cd26ac44400b55e251fc2811f4b79dd",
+ "destinationSha256": "56e029b0d481114ddc5ea1034fd30d292cd26ac44400b55e251fc2811f4b79dd",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/discovery-integrations/kody-contract.ts",
+ "destination": "src/chat/server/discovery-integrations/kody-contract.ts",
+ "sourceSha256": "d99c8a703a8930439fafb8cfc215db7d21b5dc248158345a25ade008ee5cec7e",
+ "destinationSha256": "d99c8a703a8930439fafb8cfc215db7d21b5dc248158345a25ade008ee5cec7e",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/discovery-integrations/kody-inventory.ts",
+ "destination": "src/chat/server/discovery-integrations/kody-inventory.ts",
+ "sourceSha256": "03d3ecf336b8445cf26785a8ec786bc27157cdbee9bcce888fa353e2096729ca",
+ "destinationSha256": "03d3ecf336b8445cf26785a8ec786bc27157cdbee9bcce888fa353e2096729ca",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/discovery-integrations/kody.ts",
+ "destination": "src/chat/server/discovery-integrations/kody.ts",
+ "sourceSha256": "ddb2a0703f7072d0b28561cc71b60d91541d45b6ed8399422f38bbbbcf418303",
+ "destinationSha256": "ddb2a0703f7072d0b28561cc71b60d91541d45b6ed8399422f38bbbbcf418303",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/discovery-model.ts",
+ "destination": "src/chat/server/discovery-model.ts",
+ "sourceSha256": "6073425f9350f01ca6630dd67608f55f98ef5eea1ea095ceb44c101e0b1f3bfc",
+ "destinationSha256": "0905f303849795d8fa240dec6054ca8180a6197f0697d6776751748d1cda1ff3",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/draft-files.ts",
+ "destination": "src/chat/server/draft-files.ts",
+ "sourceSha256": "155ff8411d217b7b4a7d72f3d5489b82f26c38821aa0c0582335749f8ec3a524",
+ "destinationSha256": "4111036842cb2b7b29c2c660f404708df1615d7ba0cd96bf8789ab095b7422e6",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/durable-results.ts",
+ "destination": "src/chat/server/durable-results.ts",
+ "sourceSha256": "2f0d2dee8148b1e64c93d37918dd692d2030ef89958396da8f9f494f7da013a1",
+ "destinationSha256": "86dd35979d6ebc4ef5b99caf178988595c62a21475011ba4a0512a9b330edf04",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/execution-authority.ts",
+ "destination": "src/chat/server/execution-authority.ts",
+ "sourceSha256": "4235387e77d47c9ea05378ad4e0ce67f0924467e7185ae7c107dcfe5af3880ec",
+ "destinationSha256": "211c105c01f994cebe1f1660c23caa0cdccdbdf049da16d2f04b03bb07d8fb88",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/execution-sessions.ts",
+ "destination": "src/chat/server/execution-sessions.ts",
+ "sourceSha256": "e6f21a5ab9325b706583e76c158baec5ef4b9fc8a9f1125ee5dc12de26d6cb8f",
+ "destinationSha256": "b322a6a02af723f4c04f5c4bb660cbe4fe426a07c9b8aa52226ca19afcde62d7",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/file-api.ts",
+ "destination": "src/chat/server/file-api.ts",
+ "sourceSha256": "b1937fb880c565bb7d9a1d855c72a6e45edbe7a9b1866edb9717bdebda832873",
+ "destinationSha256": "0927671b2a5df65a3f869de8809f3122a54143365a9470eeb129b7125a1fefc8",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/gateway.ts",
+ "destination": "src/chat/server/gateway.ts",
+ "sourceSha256": "77cbe844e0fd0f0f91e5b693c62dc3f0d36ae0c8aface3080a67d0e8804865fd",
+ "destinationSha256": "2fa593c630be8b399514e8ac2020b3734ad35d9610547c6e8315ef5166f7a3e5",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/history-tools.ts",
+ "destination": "src/chat/server/history-tools.ts",
+ "sourceSha256": "eac522e597df51b57627df82811ce636e00b91da1c019e2d6b185178ab83fb50",
+ "destinationSha256": "5ab0b00fdee1fc86f7d91657397e4ce4d2a456b8bbe723eb381427f683f5a94d",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/jev-arguments.ts",
+ "destination": "src/chat/server/jev-arguments.ts",
+ "sourceSha256": "7ecfc74090ff20cadba81641c9243fc567ece19cc4f8c489087775948ff4add3",
+ "destinationSha256": "1e9478280450d4b520cf410ec6da462cd5b7a5ec50035d7c52dcc05cc41c4578",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/jev-array.ts",
+ "destination": "src/chat/server/jev-array.ts",
+ "sourceSha256": "531fed068c812175554af586edce67948cca84a6bfda726c30400edbe892879e",
+ "destinationSha256": "77f19cab9df2a568e34fe1aee28c6f45e242daf70471d4afbfed79dd79aff23d",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/jev-batched-arguments.ts",
+ "destination": "src/chat/server/jev-batched-arguments.ts",
+ "sourceSha256": "0171f521a238cc4d73959aaeb1f6dc77f003494e8f3f0b5ee3ee62132af19391",
+ "destinationSha256": "ea62a2966aacb56fc63e1a7caaff989e0f83ae574763981fd4847256cab5ffe5",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/jev-call-review.ts",
+ "destination": "src/chat/server/jev-call-review.ts",
+ "sourceSha256": "3b88c4046c1825fb1b06537ff5ce94f11fabfa0e47e346c00728c5d5244dfd19",
+ "destinationSha256": "4f787276ee0ad7e4cd98796a56caa299ceaba1ca31ace42f047ddc15232015df",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/jev-router.ts",
+ "destination": "src/chat/server/jev-router.ts",
+ "sourceSha256": "13945266943b1786c0f855288f62b17cca2654b5910c418b4a9cb297c1e5ff01",
+ "destinationSha256": "f74c50f4e69d765dd31933b1d6d737480b2d3d270929cd4aa81f9a4eb03e3ffb",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/jev-task-decisions.ts",
+ "destination": "src/chat/server/jev-task-decisions.ts",
+ "sourceSha256": "5655a6609f357e38b637ce47600d267c21983d0a085907668e7f0ce03f213568",
+ "destinationSha256": "06d6eca49580e1c5dfa3a69a9180d0d2ecc6db6fa9f0919c46df49eb5e63fbc8",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/jev-verification.ts",
+ "destination": "src/chat/server/jev-verification.ts",
+ "sourceSha256": "d90e0b1b4278a57f87940a910599176f70bb2bf6c0f66ef3dd95b97f70da170c",
+ "destinationSha256": "676d0678178b7581a6a402effd7820d986d22819a2fb8a85a4a3bd2e12650f9e",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-account-reference-catalog.ts",
+ "destination": "src/chat/server/kody-account-reference-catalog.ts",
+ "sourceSha256": "1c3965a516a03671e83b4a1d7800935f20b7584a587ba21467ea8cf9f84f0119",
+ "destinationSha256": "c2fa48dc180cb9f2edba2b4cae47d405cc348c98cb835e81866e12e16794cf5f",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-account.ts",
+ "destination": "src/chat/server/kody-account.ts",
+ "sourceSha256": "87c5342b29368b4bd3d77c48534b95d18706658dd6aa4e833359699d90fcf1b1",
+ "destinationSha256": "8d25b6a67b74e1faf5397ec6e017b286d4c71e2d0d536a38f57ed33268453711",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-actions.ts",
+ "destination": "src/chat/server/kody-actions.ts",
+ "sourceSha256": "e5691caacab29927f46325d2c3d19727584a0f68221e914e64ad59f5d9fa3991",
+ "destinationSha256": "e5691caacab29927f46325d2c3d19727584a0f68221e914e64ad59f5d9fa3991",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/kody-answer.ts",
+ "destination": "src/chat/server/kody-answer.ts",
+ "sourceSha256": "2b7853de370bb95498c80cb74b5936a38cc06392f7fbcd09154b5cb3dc072ea5",
+ "destinationSha256": "36177311063028d049e16199934de294d23c509821b7cf93ccbeff3e7b62eea2",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-assistant-discovery.ts",
+ "destination": "src/chat/server/kody-assistant-discovery.ts",
+ "sourceSha256": "a10fa8c512047d3e4db7005e2f4e2b1dceea59b4a6c426ae76cd0d1b477291e6",
+ "destinationSha256": "a10fa8c512047d3e4db7005e2f4e2b1dceea59b4a6c426ae76cd0d1b477291e6",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/kody-code-run.ts",
+ "destination": "src/chat/server/kody-code-run.ts",
+ "sourceSha256": "eb551a90bc459cc8a0a2fd0ec4a5406debe27ba326cae4324809482b892867fa",
+ "destinationSha256": "eb551a90bc459cc8a0a2fd0ec4a5406debe27ba326cae4324809482b892867fa",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/kody-guidance.ts",
+ "destination": "src/chat/server/kody-guidance.ts",
+ "sourceSha256": "3018e44b4d7c98254af371bbd78838175a6587ea86a1a6e26dd4f221b1008089",
+ "destinationSha256": "6151cc59e2444e2f94d51ee50934876dd964c6108b45f8e5a511103267e7317e",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-internal-read.ts",
+ "destination": "src/chat/server/kody-internal-read.ts",
+ "sourceSha256": "1cd1314e75f06972a3acee407b68ab67a6bde01ca2642ce8f4f92dbaea00d988",
+ "destinationSha256": "1cd1314e75f06972a3acee407b68ab67a6bde01ca2642ce8f4f92dbaea00d988",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/kody-memory-create.ts",
+ "destination": "src/chat/server/kody-memory-create.ts",
+ "sourceSha256": "ee4c6169f7e1ad033e662ff5e67cc0a53d177f53781517c82ac9d4fc575adb6c",
+ "destinationSha256": "fd4b25293c373c4961df17746bfd7ff2077a29d4731e98a4674d4c7894127edd",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-memory.ts",
+ "destination": "src/chat/server/kody-memory.ts",
+ "sourceSha256": "02fd82689ea1d82f9eb5712b1a341aa17967fea74914eaaccd9f9075d5bada5b",
+ "destinationSha256": "a171117e374a2b398a76b20faaa994f29f0e8ae410ff38faa9748792b3c07b42",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-package-actions.ts",
+ "destination": "src/chat/server/kody-package-actions.ts",
+ "sourceSha256": "67b3fd58323c4224ab461ac425f0709553a9400d1aeb61e7b106f023607a43b4",
+ "destinationSha256": "67b3fd58323c4224ab461ac425f0709553a9400d1aeb61e7b106f023607a43b4",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/kody-package-recovery.ts",
+ "destination": "src/chat/server/kody-package-recovery.ts",
+ "sourceSha256": "a3fa24dfa6986c9d4550484f1a511969e588fa3b58363cea187c77a5628c4076",
+ "destinationSha256": "a3fa24dfa6986c9d4550484f1a511969e588fa3b58363cea187c77a5628c4076",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/kody-reference-access.ts",
+ "destination": "src/chat/server/kody-reference-access.ts",
+ "sourceSha256": "5a70e41d808d2bb633c59b9e70e05aea23a426225e539dff8bd7b54dc9b204b9",
+ "destinationSha256": "b78b93cf1f4a4b561c17da1a4fefab6c4fb0054b7a89f432b963969b2eec39d8",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-reference-catalog.ts",
+ "destination": "src/chat/server/kody-reference-catalog.ts",
+ "sourceSha256": "3bb955d93c4c0d95d48455d092553798891a4d2e2261caeb231bc574c04003de",
+ "destinationSha256": "ff4dc2372a8be482481baee82988ff3f914c222dd56b2e55471a5cafce9525ec",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-resources.ts",
+ "destination": "src/chat/server/kody-resources.ts",
+ "sourceSha256": "b3e745b2f59540217c6d831d39c8ad63bcb901dabaadcdc09e9c195ceeaf6bc8",
+ "destinationSha256": "9cae624f97ee8e8fe9974066aa5bb8ea46ada50dbf30cc7261d1742897deb6e3",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-run-history.ts",
+ "destination": "src/chat/server/kody-run-history.ts",
+ "sourceSha256": "07c9d31a5ddd078bfd20f5b1844e2725d5c1bd620e7d4fa1d8e3d5e9d0f3b36e",
+ "destinationSha256": "31aa48fe8c701533c0c1444c4dc0ace7215fd300adff55ecaf8e284361d49ea5",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-run.ts",
+ "destination": "src/chat/server/kody-run.ts",
+ "sourceSha256": "b45a68c7e634dd60dd662ab1c718c31eb88b70bd03c0d23976fb67cffd44b70a",
+ "destinationSha256": "06e1fee23a1ee7ea11aa1df9bc31fe9c5020cc61e8e32c8e66a462bd5e0595c4",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-search-synced-skills.ts",
+ "destination": "src/chat/server/kody-search-synced-skills.ts",
+ "sourceSha256": "51916efce35e495115f5aff75575e76d4eebdaf7adb376a95168c73d0be15d6a",
+ "destinationSha256": "51916efce35e495115f5aff75575e76d4eebdaf7adb376a95168c73d0be15d6a",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/kody-setup-readiness.ts",
+ "destination": "src/chat/server/kody-setup-readiness.ts",
+ "sourceSha256": "68c75ac77611bcb92bb2677e327cf584b895c104c8a9994f3e6956657f971425",
+ "destinationSha256": "fd15f82e0ddf9b4646d2e9ecb222a4377ca5f2de55b039be7fd432d72cba92f6",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody-skill-catalog.ts",
+ "destination": "src/chat/server/kody-skill-catalog.ts",
+ "sourceSha256": "af1f5e74547c4c7246706306c6a18068be62d85b72bf09e1db20b71812148440",
+ "destinationSha256": "a6a50d4427431527fd45f6295417ee1ee4f77f7392d4bbb371ed8e957ba50a1c",
+ "unchanged": false,
+ "extracted": "ranking, suggestions, catalog readers, original freshness and inspection behavior"
+ },
+ {
+ "source": "src/server/kody-skill-catalog.ts",
+ "destination": "src/chat/server/kody-skill-source.ts",
+ "sourceSha256": "af1f5e74547c4c7246706306c6a18068be62d85b72bf09e1db20b71812148440",
+ "destinationSha256": "b7ecea02cfd82b8494de61615a9a9a4cd62d31476158baf922b7b48cfafbed78",
+ "unchanged": false,
+ "extracted": "source schemas, result envelope parser, collect function"
+ },
+ {
+ "source": "src/server/kody-skill-catalog.ts",
+ "destination": "src/chat/server/kody-skill-sync.ts",
+ "sourceSha256": "af1f5e74547c4c7246706306c6a18068be62d85b72bf09e1db20b71812148440",
+ "destinationSha256": "c82a66f17d464e8ea3e102c09e22662a9c23e4c52a39f19eb2cc6642dcac7f6a",
+ "unchanged": false,
+ "extracted": "sync function, adapted to Postgres transactions"
+ },
+ {
+ "source": "src/server/kody-skill-search.ts",
+ "destination": "src/chat/server/kody-skill-search.ts",
+ "sourceSha256": "3085deb10eaebc1d436d9d6232a396a4fa52ff8f3912c9aa70b0d8b0573dc747",
+ "destinationSha256": "3085deb10eaebc1d436d9d6232a396a4fa52ff8f3912c9aa70b0d8b0573dc747",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/kody-sync.ts",
+ "destination": "src/chat/server/kody-sync.ts",
+ "sourceSha256": "55d36ea6e9af95ddb287ffe851506901e9913dac4f97f7a5d5601793a365773e",
+ "destinationSha256": "f6e6b751148b19bc8184212f22b4473af38138555dec342cd4714a66b5eb9274",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/kody.ts",
+ "destination": "src/chat/server/kody.ts",
+ "sourceSha256": "d43d235e205a47ada4b5749895b1139633e1aa84393733b31c379ab0bdd8f5ea",
+ "destinationSha256": "b8ee9ce698a57a5aea684cde892cc1f725165b0f09c5f9936a5570bc4d76cf0a",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/local-task-tools.ts",
+ "destination": "src/chat/server/local-task-tools.ts",
+ "sourceSha256": "f92306bc1f89e651a2881ccc7810aa40c57825f32637125571b2e9ca3dd2a58e",
+ "destinationSha256": "f92306bc1f89e651a2881ccc7810aa40c57825f32637125571b2e9ca3dd2a58e",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/mcp-account-api.ts",
+ "destination": "src/chat/server/mcp-account-api.ts",
+ "sourceSha256": "85d3afcad4efed15514ee16c35037d4ab67026f483936e911a9c1bf1818d12da",
+ "destinationSha256": "0f22936599c9d4922b5b32d34d9fe8858e2282656cf726384d3519e7c4fed9de",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/mcp-account-runtime.ts",
+ "destination": "src/chat/server/mcp-account-runtime.ts",
+ "sourceSha256": "7c0aaad0485b6f1cc7c88b936d6cadd8c49c8b801d5ef592e42e541dcda3352a",
+ "destinationSha256": "e9daf9c68575ed99968af603cd1d3f14d0b6bf4de4946afccea1ddc64d2849f5",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/mcp-accounts.ts",
+ "destination": "src/chat/server/mcp-account-contract.ts",
+ "sourceSha256": "a6e1cead226b0b61a5edef3fa2e9855776d36af5aeb0166da070cc632e920c9f",
+ "destinationSha256": "d35ec45a326fdf905933d85c84de62afc2c663c755d39859f757d46720510ccc",
+ "unchanged": false,
+ "extracted": "account and OAuth refresh contracts"
+ },
+ {
+ "source": "src/server/mcp-accounts.ts",
+ "destination": "src/chat/server/mcp-account-reads.ts",
+ "sourceSha256": "a6e1cead226b0b61a5edef3fa2e9855776d36af5aeb0166da070cc632e920c9f",
+ "destinationSha256": "f8029e70dc03f8f2efb29fe0fd4966457c8ee37d7f52b621011e51f5a58d0d4b",
+ "unchanged": false,
+ "extracted": "summary, decrypt, list/get/read and configured/runtime server projection, with Neon authorization and storage"
+ },
+ {
+ "source": "src/server/mcp-accounts.ts",
+ "destination": "src/chat/server/mcp-accounts.ts",
+ "sourceSha256": "a6e1cead226b0b61a5edef3fa2e9855776d36af5aeb0166da070cc632e920c9f",
+ "destinationSha256": "c188a0ab4b0bcf0dc696119d428358173c2d156218b6155b8ae309c51f1f703b",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/mcp-auth-network.ts",
+ "destination": "src/chat/server/mcp-auth-network.ts",
+ "sourceSha256": "a3a8d2ce72b71ecfc16e2b30f740ea8c5f3115ba49c1f5d51759402889cfafa3",
+ "destinationSha256": "a3a8d2ce72b71ecfc16e2b30f740ea8c5f3115ba49c1f5d51759402889cfafa3",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/mcp-catalog.ts",
+ "destination": "src/chat/server/mcp-catalog.ts",
+ "sourceSha256": "f351a53cd0e043000862ef8a24eaccd8294e9de61e886effd1f58e0babc32738",
+ "destinationSha256": "d37981cebb6b464a3a5e7abf48fa206d794d5c6f0155b4d305d4ed422735568b",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/mcp-connections.ts",
+ "destination": "src/chat/server/mcp-connections.ts",
+ "sourceSha256": "878f9091ee18edcd29aaf619f09a65e2be59c172be9be922791a2ced0eec04e5",
+ "destinationSha256": "d96a34c401243a723aa27c892c44b79c7479fd65edb123b19033a1346beedda5",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/mcp-discovery.ts",
+ "destination": "src/chat/server/mcp-discovery.ts",
+ "sourceSha256": "da77e146c8f2342c9dbf2bd131784171e165cba8f476d54ad6e75e075df7db54",
+ "destinationSha256": "da77e146c8f2342c9dbf2bd131784171e165cba8f476d54ad6e75e075df7db54",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/mcp-oauth-discovery.ts",
+ "destination": "src/chat/server/mcp-oauth-discovery.ts",
+ "sourceSha256": "6d8ca05fe9b9dd4c83cd6a4f9d686291eb29a9cb07fbd13cfb7e0c10aecb5ce7",
+ "destinationSha256": "6d8ca05fe9b9dd4c83cd6a4f9d686291eb29a9cb07fbd13cfb7e0c10aecb5ce7",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/mcp-public-fetch.ts",
+ "destination": "src/chat/server/mcp-public-fetch.ts",
+ "sourceSha256": "66c40f1595ece5111f115884f05f8c158111ff928364a91f6432066616941a78",
+ "destinationSha256": "669aff134352a37ee7a004bff6691b0e41bd1ed03235eacf9f333f38966df8e3",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/mcp-session-store.ts",
+ "destination": "src/chat/server/mcp-session-store.ts",
+ "sourceSha256": "9d1a797925a29415ba2681a6692ff76b7803cf446531446bf9ec9192703c576f",
+ "destinationSha256": "760c119836ff60cd194e7b4e4b6c1961bd479e05999b93a4a8e32cf8df853540",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/mcp-setup.ts",
+ "destination": "src/chat/server/mcp-setup.ts",
+ "sourceSha256": "ac95395ae73f3cd7d5bcbcdb9708c23ef110fb510351999a3c83482f56c254b2",
+ "destinationSha256": "a1055dbe4d84016b7b0f67430411deb4e25c4d963c0ad574c8c71f65a343eb61",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/mcp-task-host.ts",
+ "destination": "src/chat/server/mcp-task-host.ts",
+ "sourceSha256": "d745ddde24baa6b4fd96a3b3b8e0711a33f3ad08af14a8e6f61c18859614e983",
+ "destinationSha256": "d745ddde24baa6b4fd96a3b3b8e0711a33f3ad08af14a8e6f61c18859614e983",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/mcp.ts",
+ "destination": "src/chat/server/mcp.ts",
+ "sourceSha256": "600e0872b581ef5a3164310723171aacb04b163d8ab3ba31f007728013dd6251",
+ "destinationSha256": "317045f61cf6e179c5a14624898e4ad024e99f17780006913d6f7538c4b87d6e",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/memory.ts",
+ "destination": "src/chat/server/memory.ts",
+ "sourceSha256": "46dda6fc1afa60439940c761766028468313bb8db3b966e9eee704242fdbeb28",
+ "destinationSha256": "9fc68e1da057dd0c6ebd887377434edd8c3c55df2afdfe8adc6d1b24bd377c9e",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/message-attachments.ts",
+ "destination": "src/chat/server/message-attachments.ts",
+ "sourceSha256": "0df36e572b4d8162b76c00d4991df0d71b0207cbe860c4579c35357fd9bc5fd1",
+ "destinationSha256": "2424152a36c4b41b4b33df4d8a08625d2de8d95d7d839e9f29c317ffa1b22a70",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/message-references.ts",
+ "destination": "src/chat/server/message-references.ts",
+ "sourceSha256": "05fc0faab9f0dd1ab1049ffc9542926a86ae9ad29984a43adcbf96ca53bb5263",
+ "destinationSha256": "e0994c4ffd45cea4ec28aa03ba8c8dc2f524e02910a9b73f03da5481c2e29880",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/model-attachments.ts",
+ "destination": "src/chat/server/model-attachments.ts",
+ "sourceSha256": "2c5b13984db5ce8dc3c8a63dfd22c13ff22ff44e24ccc53ed75b3cede67355c7",
+ "destinationSha256": "7cd9cb147f620b039e2196261354bb800bd4954656365d4382fc00cffb55cb37",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/native-file-delivery.ts",
+ "destination": "src/chat/server/native-file-delivery.ts",
+ "sourceSha256": "9e6aa9d0ff7a41906353fd08a2bc3e3f325c31f7722b30dedaa09576d4ac2d95",
+ "destinationSha256": "73d433eadea95043f977aa55d5db494d0d96e20463d0db25ef654b108ed73baf",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/onboarding.ts",
+ "destination": "src/chat/server/onboarding.ts",
+ "sourceSha256": "d64ad0d27f033cfd600451ebc400e31f19579634e6a2f7db03d491505876e7f3",
+ "destinationSha256": "9aff8a66f4128ed80949cd3681d360db2b3a92d670bab60d53786cb88517211c",
+ "unchanged": false,
+ "sourceSection": "complete original read/update semantics and errors; PostgreSQL transaction and row locks replace D1 batch/receipt-gated writes"
+ },
+ {
+ "source": "src/server/ordered-history.ts",
+ "destination": "src/chat/server/ordered-history.ts",
+ "sourceSha256": "5e3587d4a48aed53c349a20c1e0ef2c19a08dac9a5b58aa74de55b3f02412238",
+ "destinationSha256": "988cc6a0cc94763ba9decc750735e5a5c7ec2a2690ae9b396418cfa4b8785a19",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/plugin-api.ts",
+ "destination": "src/chat/server/plugin-api.ts",
+ "sourceSha256": "578a4905763afd603b4e4e19de9a20d9133a046b65e27138190ce6bf668bb9ba",
+ "destinationSha256": "45f169c40c795959e6d1f6105bea81b9ec93af6dd305df4bf5057fbf6361269a",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/plugin-connections.ts",
+ "destination": "src/chat/server/plugin-connections.ts",
+ "sourceSha256": "8cad24f7b8bf79109b07838632d1f79ac7d5a21fe71bf867bbe1b50a2a3af105",
+ "destinationSha256": "59770b05538b809c96f248163cabd0941f8320aeeaa5ebded17931a1416ff6c4",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/plugins.ts",
+ "destination": "src/chat/server/plugin-contract.ts",
+ "sourceSha256": "18c9368b1a8a4842bc161fe80c1c2c481c8dec6e4cabff49cc682ca7c57a8446",
+ "destinationSha256": "74ca4b5a580b47b9a59db9c74e3fa4aef2d86cc2dfacb8d153d6b2631d0b584d",
+ "unchanged": false,
+ "extracted": "scope, errors, version pins, origin and binding types"
+ },
+ {
+ "source": "src/server/plugins.ts",
+ "destination": "src/chat/server/plugin-packages.ts",
+ "sourceSha256": "18c9368b1a8a4842bc161fe80c1c2c481c8dec6e4cabff49cc682ca7c57a8446",
+ "destinationSha256": "86a20ed757dd21cd1c1120fe034ae5142becd178cfde0cee7df6cec8e31972e3",
+ "unchanged": false,
+ "extracted": "preview, inspect, resolveMetadata, authorizeVersion, resolve and readFile protocols adapted to Neon; inspectSkill and resolveSkill; original listSkills pagination and pins"
+ },
+ {
+ "source": "src/server/plugins.ts",
+ "destination": "src/chat/server/plugins.ts",
+ "sourceSha256": "18c9368b1a8a4842bc161fe80c1c2c481c8dec6e4cabff49cc682ca7c57a8446",
+ "destinationSha256": "f94950bf662e1e7929394b27ef2391cd55fe2c205ff72b1b4907ceefccc7ee05",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/provider-observation.ts",
+ "destination": "src/chat/server/provider-observation.ts",
+ "sourceSha256": "a31f3846ba4d268dab6672f55150054b091f205da8cdc42215312d92f227e33b",
+ "destinationSha256": "a31f3846ba4d268dab6672f55150054b091f205da8cdc42215312d92f227e33b",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/provider-request-shape.ts",
+ "destination": "src/chat/server/provider-request-shape.ts",
+ "sourceSha256": "c0253408bedd83440b7278c2e9bf70c1c57c56293165d5801c3b13b30397201f",
+ "destinationSha256": "c0253408bedd83440b7278c2e9bf70c1c57c56293165d5801c3b13b30397201f",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/provider-token-totals.ts",
+ "destination": "src/chat/server/provider-token-totals.ts",
+ "sourceSha256": "f1d68a07020f3be32f5a12b6a40c6a0568f9819fb5ca9ac89d356ed2cd77f158",
+ "destinationSha256": "f1d68a07020f3be32f5a12b6a40c6a0568f9819fb5ca9ac89d356ed2cd77f158",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/providers.ts",
+ "destination": "src/chat/server/providers.ts",
+ "sourceSha256": "b5ea35fb2d6accf603b23d240040de65aa262a56b3563a539b7587829e9c347f",
+ "destinationSha256": "84d9868ba36260f6e8af72214f60f2e4755ddd5e755a99656d5758e8e60bd747",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/public-endpoint.ts",
+ "destination": "src/chat/server/public-endpoint.ts",
+ "sourceSha256": "95f6f9e7bd296c0cac85477554ea2a69ed6a8f32885dd31a606e8581c4386d18",
+ "destinationSha256": "95f6f9e7bd296c0cac85477554ea2a69ed6a8f32885dd31a606e8581c4386d18",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/research.ts",
+ "destination": "src/chat/server/research.ts",
+ "sourceSha256": "fca733d2eed2114275dc20ec6913d3192d53a7b7e85d32923c0dbeade4c64485",
+ "destinationSha256": "4714b07600d34e911ee3487cea254a00bdafd0e540e216da42bb94fd4ad18ede",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/run-models.ts",
+ "destination": "src/chat/server/run-models.ts",
+ "sourceSha256": "b16ceeb37fabf14a5306741fbbfa210b6c0a64d4f3895c66080205b550a48d82",
+ "destinationSha256": "fa6f8b2a0cfe8524cf3e78527fe9a24301fdadb6d87084f8ef27f4513dbe8950",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/run-usage.ts",
+ "destination": "src/chat/server/run-usage.ts",
+ "sourceSha256": "1cfa46b49ab0553845c3456af0e4c1667831edaa49d8f4c6611b7df418ddcf31",
+ "destinationSha256": "6d9c0fe0a021253d9e357ecad6e17fecc910565409cc250bf7332301145fcc25",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/saved-file-contract.ts",
+ "destination": "src/chat/server/saved-file-contract.ts",
+ "sourceSha256": "b065ab25a8e1d675372444fa056d3cd9f09f8ecf100604077c2f6bd743e788d6",
+ "destinationSha256": "b065ab25a8e1d675372444fa056d3cd9f09f8ecf100604077c2f6bd743e788d6",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/saved-files.ts",
+ "destination": "src/chat/server/saved-files.ts",
+ "sourceSha256": "86132f8b280f680a9b1a540d9ffa647efb417bb80e6bed7c731e3cae196b61ea",
+ "destinationSha256": "a7a1344321ad34734c97b33da6ea71d8bd497bc47b5bb9801443117d92d0db47",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/schedule-clock.ts",
+ "destination": "src/chat/server/schedule-clock.ts",
+ "sourceSha256": "959921027b2a694b706d14af63a377e08f1ef777f08ee1bce1ad172f5f69a1b5",
+ "destinationSha256": "959921027b2a694b706d14af63a377e08f1ef777f08ee1bce1ad172f5f69a1b5",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/schedule-lifecycle.ts",
+ "destination": "src/chat/server/schedule-lifecycle.ts",
+ "sourceSha256": "05968e249d3059484f9f7f1b0e9b381deb1f4d61413a8599e0fe160597ba8dde",
+ "destinationSha256": "c1defa25058e93db985ab9c4aa503c6760e5a2c4235902b4eabf5998c7e2bc6f",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/schedule-time.ts",
+ "destination": "src/chat/server/schedule-time.ts",
+ "sourceSha256": "1bd2ae0b8ec46c9c34ba298413f8c18c0517d81ac32295090794fd5269b46719",
+ "destinationSha256": "1bd2ae0b8ec46c9c34ba298413f8c18c0517d81ac32295090794fd5269b46719",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/schedules.ts",
+ "destination": "src/chat/server/schedules.ts",
+ "sourceSha256": "a86fdcc7e96f024bd7abcdb20f0cb1a3268f8ce170e87804b42961629cbdbc31",
+ "destinationSha256": "7199122760ea6883ccfcb421aafaeaa5000b83c2190a4859cd9ff05e0abaca2e",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/setup-evidence.ts",
+ "destination": "src/chat/server/setup-evidence.ts",
+ "sourceSha256": "0f8c06a6e44b8f8855ce1bf5a9bf6629bf31d7dcb10f78b5b99c04807e1ea69e",
+ "destinationSha256": "0f8c06a6e44b8f8855ce1bf5a9bf6629bf31d7dcb10f78b5b99c04807e1ea69e",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/skill-api.ts",
+ "destination": "src/chat/server/skill-api.ts",
+ "sourceSha256": "2156739d86ebd05937a7d65ab7d2bc01820408bce0fb1883a1b35c6beaf7e55d",
+ "destinationSha256": "967a7749ebdbab5383306a86ad40480fa44bef5e5b11fb50276b63fd4b82df67",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/skill-catalog.ts",
+ "destination": "src/chat/server/skill-catalog.ts",
+ "sourceSha256": "df13c3a73da2bbc4fdbdd3eb5d07e60555741dac434ce5a2197a993cc1e0e9de",
+ "destinationSha256": "732824c7f98d4e7f1881505bf4456e37298990d48a154956d65b1b5d199d731e",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/skills.ts",
+ "destination": "src/chat/server/skills.ts",
+ "sourceSha256": "6883e56024e4527f04bbbab8db88365c60de511a7b033c54fa86723f7f4413ac",
+ "destinationSha256": "0872ac1a120ff996ed1c3e1181507d4f8cc0580575c8447a5bea50879a98431b",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/stored-results.ts",
+ "destination": "src/chat/server/stored-results.ts",
+ "sourceSha256": "cdae253c460b9dc8af05d52a0bcfbc879344aa4d6e48f9c4908e5d4ac9bfc0b6",
+ "destinationSha256": "cdae253c460b9dc8af05d52a0bcfbc879344aa4d6e48f9c4908e5d4ac9bfc0b6",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/stream-append.ts",
+ "destination": "src/chat/server/stream-append.ts",
+ "sourceSha256": "f48e3b21e7e9415a58e0ea2fc51fb73953eaef600e513d11567a17972c26d9a4",
+ "destinationSha256": "f48e3b21e7e9415a58e0ea2fc51fb73953eaef600e513d11567a17972c26d9a4",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/system-one-loop.ts",
+ "destination": "src/chat/server/system-one-loop.ts",
+ "sourceSha256": "07693e3a998ea4c5a89b160353ec81e8ba2dc71a14ed25d8f48ea26213db05e7",
+ "destinationSha256": "1bb5d80609e7481321d39445874bfb91260b35041261a265da1fd2bf02f99ce3",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/task-history.ts",
+ "destination": "src/chat/server/task-history.ts",
+ "sourceSha256": "666371b438eafaf87f5a953f49c95e3a2f1ea192f055fe9f7412ba0e2665bdec",
+ "destinationSha256": "9c4d9089830fc8d05d90c6434bbbfc1be5327585bcd0a980d54e2d34402b2d98",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/task-plugins.ts",
+ "destination": "src/chat/server/task-plugins.ts",
+ "sourceSha256": "74ec43fc8af8f8ddedca9c2f35fe1df3843a7c444a96b2ca4bd334ea2609925e",
+ "destinationSha256": "0ded1ac14367f845ba80ad33d4493f9bad5bcf0ba13b61c887892fd4f143a891",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/task-skills.ts",
+ "destination": "src/chat/server/task-skills.ts",
+ "sourceSha256": "d5c564f30cc2f879d897aa4611773def76a29a164b6420e687749273ae0e2c60",
+ "destinationSha256": "eda2d8a719ab1e2887895866306567379809a7834fe2fad34d04835541690495",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/tool-proposals.ts",
+ "destination": "src/chat/server/tool-proposals.ts",
+ "sourceSha256": "87866ef88f1a129ac10981c4a81a368e21d970cd06a12e5d48527088052aa6fc",
+ "destinationSha256": "0634b2e49eb9110fd37235c4a145b23986189383b41360e859042f3354cad2b7",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/tool-reference-catalog.ts",
+ "destination": "src/chat/server/tool-reference-catalog.ts",
+ "sourceSha256": "90d612cda64ffc137b17f8c58de2314252d3f36265a2b0371839fe114d7c12b2",
+ "destinationSha256": "d90f7cb594f3ab24fb7024632653588b98aadda76eee3f5b6a78da94ea7f5ea6",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/transcript-archive.ts",
+ "destination": "src/chat/server/transcript-archive.ts",
+ "sourceSha256": "ad6c819fab44f327dddb062a0ac0863ae926051d72dcb05974d30da67225e253",
+ "destinationSha256": "f8fca9af49090a953aa39e821eae5f687140707c2f79f95293f588743fd78a79",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/type-contract.ts",
+ "destination": "src/chat/server/type-contract.ts",
+ "sourceSha256": "db0c0a7ae974d4228d52fafc459c6d7fed4b98728a0482b26f5921261ade8a93",
+ "destinationSha256": "db0c0a7ae974d4228d52fafc459c6d7fed4b98728a0482b26f5921261ade8a93",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/usage-cost.ts",
+ "destination": "src/chat/server/usage-cost.ts",
+ "sourceSha256": "7bca30f79dbfcd651eb301d7090155ef7ac4fa788b51a25fc2e8d11e6afa5bbf",
+ "destinationSha256": "7bca30f79dbfcd651eb301d7090155ef7ac4fa788b51a25fc2e8d11e6afa5bbf",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/usage.ts",
+ "destination": "src/chat/server/usage.ts",
+ "sourceSha256": "95770f8dd9090cd8539f7b38d2d6858ac224825a91f513c0bdb6f2ffb29aae65",
+ "destinationSha256": "f49e556d775ee287db2e5965255623d02b06c643f70656ee962f368ddbf35757",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/value-candidates.ts",
+ "destination": "src/chat/server/value-candidates.ts",
+ "sourceSha256": "0aff87aa0deee733128d5a025a1d33847b29f303a9761d68acaf73fb5f766102",
+ "destinationSha256": "0aff87aa0deee733128d5a025a1d33847b29f303a9761d68acaf73fb5f766102",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/workflow-admissions.ts",
+ "destination": "src/chat/server/workflow-admissions.ts",
+ "sourceSha256": "a94c3338303a3ed0f230e6c6f3e47c603893b4da3bd961a65bd9cf8466b9aba3",
+ "destinationSha256": "7f2079b211a2e6bf9f4810bcd94dc0ad9f7c43ec9337e7e388c5111c028ba54a",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workflow-authority.ts",
+ "destination": "src/chat/server/workflow-authority.ts",
+ "sourceSha256": "4434330e82c13fa2205daf242bbd8037fdd83e86a9d99a732fdce8fd3b3dd4a1",
+ "destinationSha256": "5daa7e01b881adca9d21395522baff39ca79dfc485b5e6ccc2401974b8da3ece",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workflow-children.ts",
+ "destination": "src/chat/server/workflow-children.ts",
+ "sourceSha256": "2be7f07ee40d51f5132aacc4f83a18fcdc29b224d8099434cabe044fe7f2afc4",
+ "destinationSha256": "cc795953b9a78a209796604dcf0883e77c58c5736cb7a662501037ca546fb03b",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workflow-context.ts",
+ "destination": "src/chat/server/workflow-context.ts",
+ "sourceSha256": "0755e4235248e2e6bb18844d125ddd9814163b5e04fd695fc3b1561d1f85ff6d",
+ "destinationSha256": "bca1e2236d9be76b03cb5c84fc7696d614c9813a5639936f9c569322b22a6930",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workflow-driver.ts",
+ "destination": "src/chat/server/workflow-driver.ts",
+ "sourceSha256": "fdee5538e5fe2d58e8b84433b723eed48337a12c4a6363e3be790160d4b37050",
+ "destinationSha256": "dbf52e72b64396a6b71347851d01f62ce7caab810c8e90b9793586a37e8573c2",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workflow-file-input.ts",
+ "destination": "src/chat/server/workflow-file-input.ts",
+ "sourceSha256": "6ba7ca1ea6d10f2961a3da344c140075f5303efd793bc4b973da1cdb98f57505",
+ "destinationSha256": "6ba7ca1ea6d10f2961a3da344c140075f5303efd793bc4b973da1cdb98f57505",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/workflow-input-store.ts",
+ "destination": "src/chat/server/workflow-input-store.ts",
+ "sourceSha256": "5964ff70a7fd58e2a83e593c3a6bd528b46ac6d81c59115294da214aa00bd799",
+ "destinationSha256": "5964ff70a7fd58e2a83e593c3a6bd528b46ac6d81c59115294da214aa00bd799",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/workflow-inputs.ts",
+ "destination": "src/chat/server/workflow-inputs.ts",
+ "sourceSha256": "3974e306908d3b73f03514b3822b862edeea5ae082a78005d0e5b7a4d4ffa43f",
+ "destinationSha256": "3974e306908d3b73f03514b3822b862edeea5ae082a78005d0e5b7a4d4ffa43f",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/workflow-launches.ts",
+ "destination": "src/chat/server/workflow-launches.ts",
+ "sourceSha256": "09882806f8f9748d78e6bd4fe8fc1c63f583df1ef78d5ae09471ac001c4ee84b",
+ "destinationSha256": "c2ef38f05b0ada629cbac33692e74597bec2c934b164e1203b25bb24347ea043",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workflow-results.ts",
+ "destination": "src/chat/server/workflow-results.ts",
+ "sourceSha256": "2be9cc549f2c69df92e2ab8c80dd03c2fafd4a0098b8a4d835da14851ed0e2eb",
+ "destinationSha256": "ad85ae34d7628433a5cc1173709284dd62e31c56d76a1543fa9606b253baf4bc",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workflow-runs.ts",
+ "destination": "src/chat/server/workflow-runs.ts",
+ "sourceSha256": "da87d64c95f4c9cfae3e6af00a63c3f9b84efb76bc525f3661e5f4fce7cca123",
+ "destinationSha256": "1eb33d9af7a0f30bd901593d8f7fa3d0d7aeab1eac3568fa9be01af6c4face84",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workflows.ts",
+ "destination": "src/chat/server/workflows.ts",
+ "sourceSha256": "474b59e7bf2f954ef706fd3875ed2e646cc952576a3153f0d15a64fb9998f499",
+ "destinationSha256": "d5fdc1cd69caf16a7824c8e85e240277b2258d8955d2ea7ea8391c039b5d3831",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workspace-request.ts",
+ "destination": "src/chat/server/workspace-request.ts",
+ "sourceSha256": "2c0044b3389c46070e4bd2860955cacbdc4da28dbcb4e845a96d5169c59a5241",
+ "destinationSha256": "2c0044b3389c46070e4bd2860955cacbdc4da28dbcb4e845a96d5169c59a5241",
+ "unchanged": true
+ },
+ {
+ "source": "src/server/workspace-sync-object.ts",
+ "destination": "src/chat/server/workspace-sync-object.ts",
+ "sourceSha256": "26f342613a657cc7d89de10b01524dea75e5d10c238cbeee3de5822f6234db3e",
+ "destinationSha256": "39f418f662f57014d0cebfb1afb364cbed676abd465824fc27b329f9f6596a67",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workspace-sync.ts",
+ "sourceSection": "syncMembership and readSyncProjection",
+ "destination": "src/chat/server/workspace-sync-projection.ts",
+ "sourceSha256": "df803103249fae57ece55dc7fd221f8415d9b233c62c70538009543e6a7a1ee4",
+ "destinationSha256": "b5d48a21a0692c862362e474c9831e991887d965a0f75350726ad6dd2b43736d",
+ "unchanged": false
+ },
+ {
+ "source": "src/server/workspace-sync.ts",
+ "destination": "src/chat/server/workspace-sync.ts",
+ "sourceSha256": "df803103249fae57ece55dc7fd221f8415d9b233c62c70538009543e6a7a1ee4",
+ "destinationSha256": "b9f70c033f0c6c089230c30bfd2b2c8a013915c3c084e7b8d1cd7fee647e2662",
+ "unchanged": false,
+ "sourceSection": "workspace stream transport, durable publisher, wake and recovery; projection readers extracted separately"
+ },
+ {
+ "source": "tests/workflow-driver.test.ts",
+ "destination": "harness-tests/core/workflow-driver.test.ts",
+ "sourceSha256": "16fd8cd5d73fe1dd7a4c66bc7d0d9812bf07dbf0ddf64da55b9165193ad8e56f",
+ "destinationSha256": "682caad0a1b863f51e01afa9b44b6db07977b5fc3c175d9fa9c253c4bbfac60d",
+ "unchanged": false
+ },
+ {
+ "source": "wrangler.jsonc",
+ "destination": "wrangler.jsonc",
+ "sourceSha256": "de52d4e5a762d550bd5f1f0720d7103ef4552041bbda0009d767d46f55e65448",
+ "destinationSha256": "c9736f4ef4f437ac98fcf12788fffb5ff9277b08009eaffb1162ff56f7fa93b2",
+ "unchanged": false,
+ "sourceSection": "STREAMS and WORKSPACE_SYNC bindings and new SQLite Durable Object migration"
+ },
+ {
+ "source": "src/server/workspace-index.ts",
+ "destination": "src/chat/server/workspace-index.ts",
+ "sourceSha256": "20866f556a2c9953a848c30bc10a261f16a81871f0f88249a1b6814dbb6e9ece",
+ "destinationSha256": "be476049ac77a181069a106b1ee8bfa84381c01c5e7acc5de06cea5335ee9ea6",
+ "unchanged": false,
+ "adaptation": "Removed D1 argument and imported the existing native PostgreSQL workspace reads. Original composition and response shape retained."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "workspace-sync/snapshot and workspace-sync/stream branches",
+ "destination": "src/chat/server/workspace-sync-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "48e309127d892dc1ff7c3c59b220e36f1a3dcb9ef05033c03d3f640af52a64ae",
+ "unchanged": false,
+ "adaptation": "Original HTTP behavior retained with native PostgreSQL workspace reads and shared TanStack authentication and JSON responses."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "indexResponse helper",
+ "destination": "src/chat/server/workspace-index-response.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "352e66103ca50cdde89f91f99cd6e9cba8d44f7eb2782881839471fb45f81aea",
+ "unchanged": false,
+ "adaptation": "Original HTTP behavior retained with native PostgreSQL workspace reads and shared TanStack authentication and JSON responses."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "bots POST; botMatch mutation dispatch; bots/bulk; bots/move; workspace-history POST",
+ "destination": "src/chat/server/bot-mutation-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "2032af386f20b7aaf36ff440552dc38f57f2e0b055d59c8d9121fcec8784abfa",
+ "unchanged": false,
+ "adaptation": "Original operation dispatch to ported native services, shared TanStack session and workspace membership authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "sections POST and sectionMatch PATCH/DELETE dispatch",
+ "destination": "src/chat/server/workspace-sections-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "e1eceba598d3ab8365e7cbd23cdb729554ec2bbd59c74dcb28edbb0323e075fe",
+ "unchanged": false,
+ "adaptation": "Original operation dispatch to ported native services, shared TanStack session and workspace membership authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "bots/bulk POST command loop",
+ "destination": "src/chat/server/conversation-bulk-actions.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "91053338bf591186e4ed17073363e95fca14afa5ed98ff72cb87163447edc0f5",
+ "unchanged": false,
+ "adaptation": "Original command loop extracted unchanged, database service already native, input passed as an argument."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "model-options GET branch",
+ "destination": "src/chat/server/model-options-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "e6b210f65cca762e7b0a696925f3777ce27cbb700bd96748ddc49d943bc4736f",
+ "unchanged": false,
+ "adaptation": "Original model catalog operation, shared authenticated identity and native workspace policy boundary."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "recipes POST and recipes/:id DELETE branches",
+ "destination": "src/chat/server/saved-actions-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "eadd641fdba02968a1c82198f2feead203cf0adbbaf26502ea94aabbbc75777b",
+ "unchanged": false,
+ "adaptation": "Dispatch to the previously ported native SavedActions service, shared account/workspace auth and bounded request parsing."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "connection POST branch",
+ "destination": "src/chat/server/provider-connection.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "c8f7afb0d9091672d63e26adf1d01f9344864fb0f2a781acbccf8c45bd60af38",
+ "unchanged": false,
+ "adaptation": "Original credential updater retained, native encrypted storage and shared session/workspace boundary."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "connection POST branch",
+ "destination": "src/chat/server/provider-connection-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "39a356dfb610a97d3b027903080e99cef0825daf61734f9f0cf10bfcd85fbab6",
+ "unchanged": false,
+ "adaptation": "Original credential updater retained, native encrypted storage and shared session/workspace boundary."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "threadRoute threads/thread GET/POST/DELETE dispatch",
+ "destination": "src/chat/server/conversation-threads-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "6edba82aa9c4e259e7ec2ec0172ccacd5db1d6b23dc55fce40719923006edd58",
+ "unchanged": false,
+ "adaptation": "Original operation dispatch, shared account/workspace authorization and native thread service."
+ },
+ {
+ "source": "src/server/api.ts",
+ "sourceSection": "fileRoute bots/bot-drafts/conversations dispatch to fileApi",
+ "destination": "src/chat/server/file-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "005b9f55ad0e1f43bb5ea476648eb0d184c89013c8cc35a0c4a1c6d30eb63bf8",
+ "unchanged": false,
+ "adaptation": "Original fileApi dispatch with shared session/workspace checks and native conversation ownership resolver."
+ },
+ {
+ "source": "src/server/bot-drafts.ts",
+ "sourceSection": "BotDrafts.start model/attachment/reference preparation and conversation admission",
+ "destination": "src/chat/server/bot-draft-start.ts",
+ "sourceSha256": "68160fcf9f7c522828ff5923959a30898921ec17cf684050d3e511a15f88ac9e",
+ "destinationSha256": "c7fdfbddb5d635eb5ea50e434be03dfb8745a09e742be03c8254c5c8d9c56ed6",
+ "unchanged": false,
+ "adaptation": "Source preparation block copied directly, original begin payload preserved. Native reservation and started receipt replace D1 writes. Fresh-only drafts require their reserved model, no legacy data migration."
+ },
+ {
+ "source": "src/server/execution-project-snapshots.ts",
+ "destination": "src/chat/server/execution-project-snapshots.ts",
+ "sourceSha256": "052d410e55da4fd77061208266615b6fe4b93647d44dc4193cfe77507f3df763",
+ "destinationSha256": "0f4098c80f11aa5ccb3e28f8175edc5e25d279bbc3a155082d035c08a69cdb49",
+ "unchanged": false,
+ "adaptation": "Explicit Cloudflare and FileEnvironment types replace original global Env, workspace query scoping excluded from original snapshot query validation. Checksum verification accepts only used size/checksums fields, native typed etagDoesNotMatch wildcard preserves conditional create semantics."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/conversation-execution-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "f12f610f847bfc8269bf7fbcf9e91c4382803533480e41c7b67c0deb5ca77b1b",
+ "unchanged": false,
+ "sourceSection": "executionRoute command, history, exact-session snapshot and event cursor dispatch",
+ "adaptation": "Original dispatch retained with shared auth, native conversation identity and scoped workspace query, TanStack response helpers and existing local execution restriction."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/conversation-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "fa56cc92a235ba57df3046af1e5e1f21038405c92563d2cfa9bfa92bdcf572a6",
+ "unchanged": false,
+ "sourceSection": "task-usage, runs and action-evidence read dispatch blocks; copy-boundary and retry-source capture",
+ "adaptation": "Original validation, RPCs and statuses retained inside shared session and native conversation ownership boundary. Native lifecycle and membership policy readers replace D1, retry JSON uses existing source parser and typed result envelope, workspace selector retained in generic API query."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/conversation-database.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "19a3d4595342bbfd58ac1b5cf3ab1b84ee1d811487a9f617a2fe408b10ecfbd4",
+ "unchanged": false,
+ "sourceSection": "workflow_children owner lookup and parent-only mutation restriction",
+ "adaptation": "Native PostgreSQL owner reader, authorized before lookup, used by shared-session control route. Verified against freshly published workflow child and main/missing conversations. Original owner/run/step metadata also forwarded in history snapshots."
+ },
+ {
+ "source": "src/server/workflow-api.ts",
+ "destination": "src/chat/server/workflow-api.ts",
+ "sourceSha256": "fcafff417e3541cd7682dd6b0590677da3fb87aa845902c535849204d918b410",
+ "destinationSha256": "0d03c895408f692c1b95b1930a50d69de454c9f11f6a4d229ffe697eccdf53cf",
+ "unchanged": false,
+ "adaptation": "Native Workflows constructor removes D1 argument, native identity import, shared workspace query omitted from original strict workflow query validation."
+ },
+ {
+ "source": "src/server/workflow-run-api.ts",
+ "destination": "src/chat/server/workflow-run-api.ts",
+ "sourceSha256": "b3f10c28ef77aabce4afae69c1c5d218a294a4abd61a999ee769d5f27508368d",
+ "destinationSha256": "0e2876201634214011b687fefadb66a0d260a04cdf4966b47f44561bf4ae82ce",
+ "unchanged": false,
+ "adaptation": "Explicit Conversation namespace environment and native identity import, generic workspace selector omitted from source query validation. Existing run RPC dispatch preserved."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/conversation-copy-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "d127a854a4e042cedbd8f56ab84236873ef5a7b8110839c0199215bb892abc64",
+ "unchanged": false,
+ "sourceSection": "copyStart/copyStatus/copySource dispatch",
+ "adaptation": "Shared session and native workspace membership, typed CopyEnvironment namespace, exact source create/status semantics."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/conversation-retry-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "06570c74903f6bb51908157fcd1b319fd94a7585e4a1283da65b7868bae52358",
+ "unchanged": false,
+ "sourceSection": "retryStart/retryStatus dispatch",
+ "adaptation": "Shared session, native identity and policy, explicit typed retry environment, fixture false server-side, original preparing status and explicit prepare/get behavior."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/workspace-activity-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "459531f7d9fae36323d93774d8842a4f20407e018f14d6827e63b8f5e7032f4a",
+ "unchanged": false,
+ "sourceSection": "activity and workspace-index/activity GET contracts",
+ "adaptation": "Shared session and native membership boundary reuse existing bootstrap activity serializer."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/workspace-policy.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "f3be8276c9bdb545962201845a78f635f8b37671f0327147c3e5c062d95223e6",
+ "unchanged": false,
+ "sourceSection": "policy POST owner-only update",
+ "adaptation": "Native PostgreSQL policy schema and conditional owner update, shared session/member/origin boundary."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/workspace-policy-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "a64f0521d4102532d64486927e39b0f3e7a8aa857de4daeb1080c722327745bb",
+ "unchanged": false,
+ "sourceSection": "policy POST owner-only update",
+ "adaptation": "Native PostgreSQL policy schema and conditional owner update, shared session/member/origin boundary."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/kody-account-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "a4a133797ea6507b6597e8c56aaf8442c2bf215dc9b57ce02b51bf66b08c46d3",
+ "unchanged": false,
+ "sourceSection": "kody/account GET and kody/sync POST",
+ "adaptation": "Shared session and native policy membership boundary, server credential/origin configuration, source service calls and bounded account cancellation."
+ },
+ {
+ "source": "src/server/kody-community.ts",
+ "destination": "src/chat/server/kody-community.ts",
+ "sourceSha256": "c9bdd29fe4844834b944c4dea9e670a86c6df947224ee873f6a4e72acb9bffb4",
+ "destinationSha256": "7e2bd77fac6f28ab6967994348d42e0a660cdad83a4568fb23a4c96577e59732",
+ "unchanged": false,
+ "adaptation": "Original complete implementation copied; global Env replaced with explicit existing KodyEnvironment. HTTP routes remain to be mounted."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/kody-account-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "f8a1899b1f62331be715aaa4a966fe81aef49a888afc5a7862621b6d1019d6af",
+ "unchanged": false,
+ "sourceSection": "Kody community search and listing GET dispatch",
+ "adaptation": "Original service inputs and cancellation retained behind shared TanStack auth and native workspace policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/community.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "ccce2d4753fd135290d619a64f0e269fa4ab2c579c8e69c91b2c54933d97181d",
+ "unchanged": false,
+ "sourceSection": "Kody community search and listing GET dispatch",
+ "adaptation": "Original service inputs and cancellation retained behind shared TanStack auth and native workspace policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/community/$listingId.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "3f86b8a70f4fde59edf5140e50aad779740af29df0969c037dd1c00cf7687fea",
+ "unchanged": false,
+ "sourceSection": "Kody community search and listing GET dispatch",
+ "adaptation": "Original service inputs and cancellation retained behind shared TanStack auth and native workspace policy."
+ },
+ {
+ "source": "src/server/kody-usage.ts",
+ "destination": "src/chat/server/kody-usage.ts",
+ "sourceSha256": "a3886848b1267445a03a84a9b50d4d95e280abe045c98e8a1eb3c2047bce3367",
+ "destinationSha256": "9eee3686826369ea3e4f0bc6a1475949ba36a5093dfc279917b1f868e0ac91e8",
+ "unchanged": false,
+ "adaptation": "Complete original implementation retained with explicit existing KodyEnvironment type."
+ },
+ {
+ "source": "src/server/kody-mail.ts",
+ "destination": "src/chat/server/kody-mail.ts",
+ "sourceSha256": "f653229b75fae3f34e6946701071b5319f39b87c6e8d8b52f3506cc0b5de1e2b",
+ "destinationSha256": "85a131d05abc5f830e9fd8542aa40ecd409086afd36cf6cb022f63438ccdfe33",
+ "unchanged": false,
+ "adaptation": "Original service copied in full; explicit existing KodyEnvironment replaces global Env."
+ },
+ {
+ "source": "src/server/kody-package-document.ts",
+ "destination": "src/chat/server/kody-package-document.ts",
+ "sourceSha256": "0068456f92ef2138270a0e7b264d442dc8b907ab5a8dcec7be38e359123b5a0a",
+ "destinationSha256": "6685683034e8aa6faf367da4248fdc29c4120884af2e0cd4b0cf9a7495d24c87",
+ "unchanged": false,
+ "adaptation": "Original implementation copied with explicit existing KodyEnvironment type."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/kody-account-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "b37a3b8adca8778c0db6bc057ebb7182df21479e25f58b51ce84691b2ec7139b",
+ "unchanged": false,
+ "sourceSection": "Original Kody account/resource/usage/mail/package document read dispatch",
+ "adaptation": "Original services and inputs retained behind shared TanStack session and workspace policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/usage.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "1ba72b93c845e021b995057d0713bdb960d40c6694cf919c0e87951fb65579ed",
+ "unchanged": false,
+ "sourceSection": "Original Kody account/resource/usage/mail/package document read dispatch",
+ "adaptation": "Original services and inputs retained behind shared TanStack session and workspace policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/mail/inboxes.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "5df960fabc639a3f8257bcce84ea1543d0d3bc54049c70489a4b1af2833a396d",
+ "unchanged": false,
+ "sourceSection": "Original Kody account/resource/usage/mail/package document read dispatch",
+ "adaptation": "Original services and inputs retained behind shared TanStack session and workspace policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/mail/messages.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "de01f83ece0dd900c6422c40cd591beea284ab21c2f22a158e5530f93bf55c7f",
+ "unchanged": false,
+ "sourceSection": "Original Kody account/resource/usage/mail/package document read dispatch",
+ "adaptation": "Original services and inputs retained behind shared TanStack session and workspace policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/mail/messages/$messageId.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "40f03bda2f348f969a55a38fa5d420d1fa7f49b7a3f94486fcc80ed08237e7dc",
+ "unchanged": false,
+ "sourceSection": "Original Kody account/resource/usage/mail/package document read dispatch",
+ "adaptation": "Original services and inputs retained behind shared TanStack session and workspace policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/packages/$packageId/document.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "e252dd16261c9ad53f772939141706514f811aa0a5e0678dfc4a8f068db8cac9",
+ "unchanged": false,
+ "sourceSection": "Original Kody account/resource/usage/mail/package document read dispatch",
+ "adaptation": "Original services and inputs retained behind shared TanStack session and workspace policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/resources/$kind.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "882f4973341b7c3dbc87524bd46f99b337029989b38b2f595e490ed8799055f8",
+ "unchanged": false,
+ "sourceSection": "Original Kody account/resource/usage/mail/package document read dispatch",
+ "adaptation": "Original services and inputs retained behind shared TanStack session and workspace policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/kody-account-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "60880c8f129fbc895c93914b8dc484842b2921d049a4ac798253ef3c4fb00336",
+ "unchanged": false,
+ "sourceSection": "Kody run history and run detail GET dispatch",
+ "adaptation": "Original service calls, filter schemas, policy denial and timeout durations preserved with shared TanStack session."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/runs.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "2454792e32a7386cb93152a62ae477e1f4e72a2152a4c2eaa9a93aab2ad02412",
+ "unchanged": false,
+ "sourceSection": "Kody run history and run detail GET dispatch",
+ "adaptation": "Original service calls, filter schemas, policy denial and timeout durations preserved with shared TanStack session."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/runs/$runId.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "b730f06feea704f74586676402d28f509c78925e93848b53b8ee2fc0dc38b486",
+ "unchanged": false,
+ "sourceSection": "Kody run history and run detail GET dispatch",
+ "adaptation": "Original service calls, filter schemas, policy denial and timeout durations preserved with shared TanStack session."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/kody-account-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "41e30182643f352e3482b32f2741263299382c1b4fae0d043bf239eb6562f3f6",
+ "unchanged": false,
+ "sourceSection": "Original Kody memory search and detail GET dispatch",
+ "adaptation": "Original service inputs and timeout retained behind shared TanStack account/workspace authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/memories.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "a3c35c3850f3df08a6bfd4b8a4325cdfa217021f9304f92aeb19bfdc49132db8",
+ "unchanged": false,
+ "sourceSection": "Original Kody memory search and detail GET dispatch",
+ "adaptation": "Original service inputs and timeout retained behind shared TanStack account/workspace authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/memories/$memoryId.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "e3a9e963877294673600c4c0b0f9234ca55f61aa35e4979fcb26f08b6312cf6c",
+ "unchanged": false,
+ "sourceSection": "Original Kody memory search and detail GET dispatch",
+ "adaptation": "Original service inputs and timeout retained behind shared TanStack account/workspace authorization."
+ },
+ {
+ "source": "src/server/kody-memory-change.ts",
+ "destination": "src/chat/server/kody-memory-change.ts",
+ "sourceSha256": "1dcd7afcfd6247d1d7854e019ae604b5121f644b606ab09cdda5c9cca1c62fbd",
+ "destinationSha256": "c8ecca73be59ce2a5891e0d45668df8a974e70352f6044b6bfa95ef8d7ca9d99",
+ "unchanged": false,
+ "sourceSection": "Complete original implementation",
+ "adaptation": "Explicit native Kody environment and shared TanStack auth; original mutation service contracts preserved."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/kody-memory-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "105d9da407331bfd4754771746312821f36e38b84d41fc4e456c37c7f84ddc73",
+ "unchanged": false,
+ "sourceSection": "Memory create/change review and apply POST dispatch",
+ "adaptation": "Explicit native Kody environment and shared TanStack auth; original mutation service contracts preserved."
+ },
+ {
+ "source": "src/server/kody-server-add.ts",
+ "destination": "src/chat/server/kody-server-add.ts",
+ "sourceSha256": "e68590dfc63d996b50b94e92b5680bff96649c7dc3dfa3bdaf6e0b9b35b86506",
+ "destinationSha256": "e09d93e7eb97fcd9d2d1c88d5ba06418a26a8e69b9aacd605767ebe8ae7c1354",
+ "unchanged": false,
+ "adaptation": "Original service copied, explicit KodyEnvironment; D1 membership/policy/link lookup replaced by equivalent native PostgreSQL joins for controls. HTTP routes pending."
+ },
+ {
+ "source": "src/server/kody-server-control.ts",
+ "destination": "src/chat/server/kody-server-control.ts",
+ "sourceSha256": "c4f3f02846883a125919fa803f937ff1712b246e3d89e13cc707fe0283f167c4",
+ "destinationSha256": "5ce7b37b26e905f3af71514b8ecb9eb0202e954dcc2d1940becfbf9311f505fd",
+ "unchanged": false,
+ "adaptation": "Original service copied, explicit KodyEnvironment; D1 membership/policy/link lookup replaced by equivalent native PostgreSQL joins for controls. HTTP routes pending."
+ },
+ {
+ "source": "src/server/kody-job-control.ts",
+ "destination": "src/chat/server/kody-job-control.ts",
+ "sourceSha256": "59fe13d05777e5d1b4dc812b5d8156eb25731d343482018cd3328febf6aefe02",
+ "destinationSha256": "ea5995d3ce5c05a7ab2528b3fe748b81185b78f3cd73d5146e80a62c0f759b4c",
+ "unchanged": false,
+ "adaptation": "Original service copied, explicit KodyEnvironment; D1 membership/policy/link lookup replaced by equivalent native PostgreSQL joins for controls. HTTP routes pending."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/kody-control-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "41c3f472e5f5144440cf7a75fdab2545b84e3548bd67a593dbca7e11d1bc995a",
+ "unchanged": false,
+ "sourceSection": "Original Kody job enable and server add/enable/reconnect/check POST dispatch",
+ "adaptation": "Source services, validation, policy restriction, timeouts and catalog invalidation retained under shared TanStack authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/jobs/$jobId/enabled.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "374e3ef381333ed4bbeecf417f23b88b5147381292814ed846246f5adc505c87",
+ "unchanged": false,
+ "sourceSection": "Original Kody job enable and server add/enable/reconnect/check POST dispatch",
+ "adaptation": "Source services, validation, policy restriction, timeouts and catalog invalidation retained under shared TanStack authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/servers.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "8bcc5ea306f7d6a168380a823c7d0aa2e08cb98c78ff62963b1e426cd65aebd2",
+ "unchanged": false,
+ "sourceSection": "Original Kody job enable and server add/enable/reconnect/check POST dispatch",
+ "adaptation": "Source services, validation, policy restriction, timeouts and catalog invalidation retained under shared TanStack authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/servers/$serverId/enabled.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "485256730c54e0743cd303a79822fe12fd3ef2bd4670ff472ee447bcaa9097cf",
+ "unchanged": false,
+ "sourceSection": "Original Kody job enable and server add/enable/reconnect/check POST dispatch",
+ "adaptation": "Source services, validation, policy restriction, timeouts and catalog invalidation retained under shared TanStack authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/servers/$serverId/reconnect.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "4cda7a869bc846d8417542f638a3ada913bc87dd84ea4f817c9f88451c718ff2",
+ "unchanged": false,
+ "sourceSection": "Original Kody job enable and server add/enable/reconnect/check POST dispatch",
+ "adaptation": "Source services, validation, policy restriction, timeouts and catalog invalidation retained under shared TanStack authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/servers/$serverId/check.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "ae4b8d6bffddf88727aad4b3bb01a97fd6801d3c53c6d86989bc679f9eadd3be",
+ "unchanged": false,
+ "sourceSection": "Original Kody job enable and server add/enable/reconnect/check POST dispatch",
+ "adaptation": "Source services, validation, policy restriction, timeouts and catalog invalidation retained under shared TanStack authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/reference-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "2c5e71ee81b9dde7402d48fffe26809e7aaaf3079a4744011202d732c3ff50a9",
+ "unchanged": false,
+ "sourceSection": "Workspace and conversation reference GET lookup",
+ "adaptation": "Original kind/query/excludeBotId inputs and listMessageReferences call retained with shared TanStack session, native policy and conversation identity."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/references.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "bbc61345cfca0de39bb71acf5d9c1cb2f6b0ed4d24c9fa40dd4b37210eb1bb00",
+ "unchanged": false,
+ "sourceSection": "Workspace and conversation reference GET lookup",
+ "adaptation": "Original kind/query/excludeBotId inputs and listMessageReferences call retained with shared TanStack session, native policy and conversation identity."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/conversations/$id/references.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "152bb402c9c5259ce80f2d9181b5b5dd2afa88bb3ca9878e1c17a61c1b1bf9b0",
+ "unchanged": false,
+ "sourceSection": "Workspace and conversation reference GET lookup",
+ "adaptation": "Original kind/query/excludeBotId inputs and listMessageReferences call retained with shared TanStack session, native policy and conversation identity."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/reference-catalog-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "0d59c9a25900509abacf7d775c5d4a60cb9ddab14d8d75253070098b22948d82",
+ "unchanged": false,
+ "sourceSection": "Reference tool refresh, parallel Kody refresh and Kody inspect dispatch",
+ "adaptation": "Original service calls, validation, allSettled semantics and cancellation preserved behind shared TanStack auth/policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/references/tools/refresh.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "76aaac6cc84920453f1fa5bafe6a400decf9b3c6a50d6c370ce1408079940cde",
+ "unchanged": false,
+ "sourceSection": "Reference tool refresh, parallel Kody refresh and Kody inspect dispatch",
+ "adaptation": "Original service calls, validation, allSettled semantics and cancellation preserved behind shared TanStack auth/policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/references/kody/refresh.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "b80df0aa780f3d1e2c5ee16498ac439978131e81d90f77a372d407d4ab08d808",
+ "unchanged": false,
+ "sourceSection": "Reference tool refresh, parallel Kody refresh and Kody inspect dispatch",
+ "adaptation": "Original service calls, validation, allSettled semantics and cancellation preserved behind shared TanStack auth/policy."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/references/kody/inspect.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "35f563840f288e30cb2003bb7b965f49eb8da96981398206196472ff00fb530c",
+ "unchanged": false,
+ "sourceSection": "Reference tool refresh, parallel Kody refresh and Kody inspect dispatch",
+ "adaptation": "Original service calls, validation, allSettled semantics and cancellation preserved behind shared TanStack auth/policy."
+ },
+ {
+ "source": "src/server/kody-run-triage.ts",
+ "destination": "src/chat/server/kody-run-triage.ts",
+ "sourceSha256": "c861dd7f29aee4f36e0d421462f065bbb0c846e2a47352c57c3b6ad6a491016f",
+ "destinationSha256": "4f9cc972cd0c3b9bde0acd40e24b8b127b41e1d301bcda19d1c271746a97803b",
+ "unchanged": false,
+ "adaptation": "Original triage service and dispatch preserved with explicit environment and shared TanStack authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/kody-control-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "39f926af8ba68b2e809aaa55894f4186a9ff5b35343ee769b2a162b74f0b9922",
+ "unchanged": false,
+ "adaptation": "Original triage service and dispatch preserved with explicit environment and shared TanStack authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/kody/runs/$runId/triage.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "12c23b409dc3864569dc2d3e1c362e94e37fb40a00b218999478b12326df88ac",
+ "unchanged": false,
+ "adaptation": "Original triage service and dispatch preserved with explicit environment and shared TanStack authorization."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/file-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "1ee9a8daf21921c9733b55a5f79a22cf9d585296d64883a8a1595fe1188df982",
+ "unchanged": false,
+ "sourceSection": "Conversation file import POST dispatch",
+ "adaptation": "Original input validation and SavedFiles.importFrom retained with native conversation identity and shared auth."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/conversations/$id/files/import.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "751b277b1bcd6c1a63cb5246e1f383578539b98ef34e6f281ec7b88335a0ec6a",
+ "unchanged": false,
+ "sourceSection": "Conversation file import POST dispatch",
+ "adaptation": "Original input validation and SavedFiles.importFrom retained with native conversation identity and shared auth."
+ },
+ {
+ "source": "src/server/memory-api.ts",
+ "destination": "src/chat/server/memory-api.ts",
+ "sourceSha256": "c0fb1250e7268344a815b25bf8780807ade4090fb066caf79ab04391ffa2d482",
+ "destinationSha256": "6d98336c40128c3323065f0712e6a30638275964106f62c53b5f7599045e91e5",
+ "unchanged": false,
+ "adaptation": "Original API copied; D1 constructor argument removed for existing native PostgreSQL Memories service. Shared session/conversation identity boundary mounted."
+ },
+ {
+ "source": "src/server/semantic-history.ts",
+ "destination": "src/chat/server/semantic-history.ts",
+ "sourceSha256": "2658908eab0d8e6cfe612c2b9b2e9b2749f337d22de1aff1118444938c05e15e",
+ "destinationSha256": "4a013cd2e11e97d08c83811d6c07a8f4a0d7762b78c57df7275ff838475dd46d",
+ "unchanged": false,
+ "adaptation": "Original implementation retained with native explicit types/shared account authorization. History imports normalized for destination TypeScript config."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/reference-catalog-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "b2f769111cdf4a62d64c5a8e403d3ef6d639d69f0de10219ca723ed75adeebfc",
+ "unchanged": false,
+ "adaptation": "Original implementation retained with native explicit types/shared account authorization. History imports normalized for destination TypeScript config."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/mcp/contract.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "8b45464d8f32492345701f56658492aafdc90ab511982cdcf1b17e8a18f9785d",
+ "unchanged": false,
+ "adaptation": "Original implementation retained with native explicit types/shared account authorization. History imports normalized for destination TypeScript config."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/chat/server/device-http.server.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "ff6aea5391e86064beb68a5626bdab06c464773a1edffd09edeecb16beb9b72c",
+ "unchanged": false,
+ "sourceSection": "Device account and dedicated bearer transport dispatch",
+ "adaptation": "Original native device service retained; shared session supplied only to account operations, transport keeps original bearer authentication."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/account/devices.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "1f1d1ee2434df84012d014160591b3fffa74387b79708b70045a50f486378253",
+ "unchanged": false,
+ "sourceSection": "Device account and dedicated bearer transport dispatch",
+ "adaptation": "Original native device service retained; shared session supplied only to account operations, transport keeps original bearer authentication."
+ },
+ {
+ "source": "src/server/api.ts",
+ "destination": "src/routes/api/chat/device-transport.ts",
+ "sourceSha256": "7a51ad09f49077214eb1298bbfcdd28cba8f5ae2dd2f7e90985ec97afdd05f24",
+ "destinationSha256": "0f474a6e218f2de8b524b3814b6af0e112a80183cc1138d56c4554d4af43e6fd",
+ "unchanged": false,
+ "sourceSection": "Device account and dedicated bearer transport dispatch",
+ "adaptation": "Original native device service retained; shared session supplied only to account operations, transport keeps original bearer authentication."
+ },
+ {
+ "source": "src/server/auth.ts",
+ "destination": "src/chat/server/kody-unlink-http.server.ts",
+ "sourceSha256": "4f1cb251794f7f043d82c8e60527e06d39a47b465cc10aeef25e7aa10d3ad0cd",
+ "destinationSha256": "09951c07f40e58e81ff5c883332466ec9cc618ddf6f5039302d1fd9e0a8561b6",
+ "unchanged": false,
+ "sourceSection": "Kody unlink credential and link removal",
+ "adaptation": "Shared TanStack session replaces Gum account auth, native PostgreSQL link deletion; no email-only login prerequisite since account identity is independent."
+ },
+ {
+ "source": "src/server/auth.ts",
+ "destination": "src/routes/api/chat/kody/unlink.ts",
+ "sourceSha256": "4f1cb251794f7f043d82c8e60527e06d39a47b465cc10aeef25e7aa10d3ad0cd",
+ "destinationSha256": "174d1b6fbefd826559877fb155df923ee3b6475645b77285864583992c941392",
+ "unchanged": false,
+ "sourceSection": "Kody unlink credential and link removal",
+ "adaptation": "Shared TanStack session replaces Gum account auth, native PostgreSQL link deletion; no email-only login prerequisite since account identity is independent."
+ },
+ {
+ "source": "src/server/auth.ts",
+ "destination": "src/chat/server/kody-connect-http.server.ts",
+ "sourceSha256": "4f1cb251794f7f043d82c8e60527e06d39a47b465cc10aeef25e7aa10d3ad0cd",
+ "destinationSha256": "108d4712f26db3cd632f23e183ba79d64dfd0d470bcce5991b3820b3a73b0875",
+ "unchanged": false,
+ "adaptation": "Ported connection initiation only. Shared TanStack identity, native PostgreSQL registration and pending state, validated registration response, scoped OAuth cookie and /api/chat callback URL. Callback remains unfinished and this handler is not mounted yet."
+ },
+ {
+ "source": "src/server/auth-popup.ts",
+ "destination": "src/chat/server/auth-popup.ts",
+ "sourceSha256": "5039421439c3942cf09336f841612b24c0903b23800c54b353432809bbe35c82",
+ "destinationSha256": "5039421439c3942cf09336f841612b24c0903b23800c54b353432809bbe35c82",
+ "unchanged": true,
+ "adaptation": "Exact original popup completion source."
+ },
+ {
+ "source": "src/server/auth.ts",
+ "destination": "src/chat/server/kody-callback-http.server.ts",
+ "sourceSha256": "4f1cb251794f7f043d82c8e60527e06d39a47b465cc10aeef25e7aa10d3ad0cd",
+ "destinationSha256": "4e9fb37596239a36a1a0671c2f3dfedf59b1f955b6141790943effba80e6c04a",
+ "unchanged": false,
+ "adaptation": "Connect-only callback port using shared TanStack session and native PostgreSQL. Preserves PKCE exchange, RS256 issuer/audience/nonce verification, verified email, account linking and credential compare-and-swap. No Gum identity/session creation. Route remains unmounted pending boundary tests and concurrent link collision recovery."
+ },
+ {
+ "source": "vite.config.ts",
+ "destination": "vite.config.ts",
+ "sourceSha256": "1b9ee909170407ac3fc2ebe427c226f59f3df82e3de395490b94b018fbd2c26c",
+ "destinationSha256": "6daf9b6fa80a95e4e775ae1a175c7f9f489a013937ce77f412a00d4fabd600d3",
+ "unchanged": false,
+ "adaptation": "Original build content hashing ported into destination Vite defines, with destination path/fs imports and config directory."
+ },
+ {
+ "source": "src/server.ts",
+ "destination": "src/routes/api/chat/app-version.ts",
+ "sourceSha256": "bc496fe7c294f4106a9749d6f1e4ea40b2ed147b6adc7b7175d8636c01562a5a",
+ "destinationSha256": "9b2871bc19bd6d7214c93952f228b53a2a9d861851c5eae074fe779825b7df79",
+ "unchanged": false,
+ "adaptation": "Original no-store public build version response mounted under /api/chat/app-version."
+ },
+ {
+ "source": "public/sw.js",
+ "destination": "public/tanchat-sw.js",
+ "sourceSha256": "9d040a823d820110ff9b3aad98f2c33f6909b9f9ddd5a8149f86154420601431",
+ "destinationSha256": "1441cfb24a312b455c1925cbf14f31e0a513cd2bc8f0311f6c505db8d87065fc",
+ "unchanged": false,
+ "adaptation": "Original network-only offline worker scoped to /chat/ with a separate public offline cache."
+ },
+ {
+ "source": "public/offline.html",
+ "destination": "public/chat/offline.html",
+ "sourceSha256": "0a3c73f6057be60895fe322551916e9e80c1eb54df0710e447d9ed1dcefe7b63",
+ "destinationSha256": "0a3c73f6057be60895fe322551916e9e80c1eb54df0710e447d9ed1dcefe7b63",
+ "unchanged": true,
+ "adaptation": "Exact source public offline page."
+ },
+ {
+ "source": "src/server.ts",
+ "destination": "src/chat/server/scheduled.server.ts",
+ "sourceSha256": "bc496fe7c294f4106a9749d6f1e4ea40b2ed147b6adc7b7175d8636c01562a5a",
+ "destinationSha256": "d93be73eb702a5a89443dbc48b90b01c7757f3e339dc83cf0ffd5864d52408d8",
+ "unchanged": false,
+ "adaptation": "Original scheduled recoverWorkspaceSync invocation restored through shared host context and native namespace validation. Runs concurrently with the existing TanStack minute workflow sweep."
+ },
+ {
+ "source": "scripts/local-mcp-egress.ts",
+ "destination": "scripts/local-mcp-egress.ts",
+ "sourceSha256": "c1619ad25e46175b594ed44895ace61ddd5ec156ae221b4b7eb2d889bf1b26e1",
+ "destinationSha256": "c1619ad25e46175b594ed44895ace61ddd5ec156ae221b4b7eb2d889bf1b26e1",
+ "unchanged": true,
+ "adaptation": "Exact original public-only relay source. Wired into shared Vite dev configuration with original runtime disposal behavior."
+ }
+]
diff --git a/docs/tanchat-source-coverage.json b/docs/tanchat-source-coverage.json
new file mode 100644
index 000000000..58613a1a1
--- /dev/null
+++ b/docs/tanchat-source-coverage.json
@@ -0,0 +1,45 @@
+{
+ "note": "File presence is not proof of feature or behavioral completeness. Adapted and split server files require runtime verification.",
+ "areas": {
+ "core": {
+ "sourceFiles": 107,
+ "samePathPresent": 107,
+ "missingSamePath": []
+ },
+ "client": {
+ "sourceFiles": 9,
+ "samePathPresent": 9,
+ "missingSamePath": []
+ },
+ "components": {
+ "sourceFiles": 220,
+ "samePathPresent": 219,
+ "missingSamePath": ["components/SignIn.tsx"]
+ },
+ "server": {
+ "sourceFiles": 185,
+ "samePathPresent": 180,
+ "missingSamePath": [
+ "server/api.ts",
+ "server/auth.ts",
+ "server/conversation-identity.ts",
+ "server/development-backend.ts",
+ "server/email-auth.ts"
+ ]
+ }
+ },
+ "sharedInfrastructureReplacements": {
+ "components/SignIn.tsx": [
+ "src/components/LoginModal.tsx",
+ "src/routes/login.tsx"
+ ],
+ "server/auth.ts": ["src/auth/index.server.ts"],
+ "server/email-auth.ts": ["src/auth/index.server.ts"],
+ "server/conversation-identity.ts": [
+ "src/chat/workspace.server.ts",
+ "src/chat/server/conversation-http.server.ts"
+ ],
+ "server/api.ts": ["src/routes/api/chat"],
+ "server/development-backend.ts": ["src/server/runtime/host.server.ts"]
+ }
+}
diff --git a/docs/tanchat-source-schema.json b/docs/tanchat-source-schema.json
new file mode 100644
index 000000000..6aa6750dd
--- /dev/null
+++ b/docs/tanchat-source-schema.json
@@ -0,0 +1,4281 @@
+{
+ "source": "Gum D1 migrations",
+ "migrationCount": 55,
+ "tables": [
+ {
+ "table": "account_onboarding",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "status",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'pending'",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "use_case",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "completed_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "account_onboarding_commands",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "command_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "request_digest",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "mutation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "result_json",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "account_onboarding",
+ "user_id",
+ "user_id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "account_preferences",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "timezone",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "timezone_confirmed_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "response_preferences",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'{\"language\":null,\"tone\":\"default\",\"detail\":\"default\"}'",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "appearance_preferences",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'{\"mode\":\"system\",\"lightPreset\":\"neutral\",\"darkPreset\":\"neutral\",\"lightCustom\":null,\"darkCustom\":null,\"lightIntensity\":65,\"darkIntensity\":65}'",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "auth_limits",
+ "columns": [
+ {
+ "name": "key",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "count",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "expires_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "bot_activity",
+ "columns": [
+ {
+ "name": "bot_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "status",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "activity_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "event_version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "read_version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "preview",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "''",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "message_count",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "queued_count",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "queue_paused",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"],
+ [1, 0, "bots", "bot_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "bot_drafts",
+ "columns": [
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "bot_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "parent_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "text",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "started_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "file_ids",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'[]'",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "run_model",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "reference_inputs",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'[]'",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "conversations",
+ "conversation_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [1, 0, "bots", "bot_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [2, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 3,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "bot_metadata",
+ "columns": [
+ {
+ "name": "bot_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "archived_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "deleted_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "updated_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "deletion_batch",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "avatar",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "bots", "bot_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "bot_schedule_suspensions",
+ "columns": [
+ {
+ "name": "bot_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "generation",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "bots", "bot_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "bot_sections",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "name",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "position",
+ "type": "REAL",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "sort_override",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "bot_viewer_state",
+ "columns": [
+ {
+ "name": "bot_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "pinned",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "section_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "position",
+ "type": "REAL",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "tags",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'[]'",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "bot_sections",
+ "section_id",
+ "id",
+ "NO ACTION",
+ "SET NULL",
+ "NONE"
+ ],
+ [1, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [2, 0, "bots", "bot_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "bot_workspace_mutations",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "expires_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "9007199254740991",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "bots",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "parent_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "name",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "purpose",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "''",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "bots", "parent_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "composer_drafts",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "scope",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "value",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "updated_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "config",
+ "columns": [
+ {
+ "name": "key",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "value",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "connected_devices",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "name",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "token_hash",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "grants",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'[]'",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "last_seen",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revoked_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "conversation_activity",
+ "columns": [
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "bot_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "status",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "activity_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "event_version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "read_version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "preview",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "''",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "message_count",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "queued_count",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "queue_paused",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"],
+ [1, 0, "bots", "bot_id", "id", "NO ACTION", "CASCADE", "NONE"],
+ [
+ 2,
+ 0,
+ "conversations",
+ "conversation_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "conversation_copies",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_bot_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "target_bot_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "target_conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "idempotency_key",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "request_digest",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "kind",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "boundary_json",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "name",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "purpose",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "parent_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "status",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'copying'",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "phase",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'export'",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "manifest_json",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "next_page",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "work_version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "error_code",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "error_message",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "attempts",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "retry_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "updated_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "completed_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "retry_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "conversation_retries",
+ "retry_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [1, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 2,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "conversation_mains",
+ "columns": [
+ {
+ "name": "bot_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "conversations",
+ "conversation_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ],
+ [
+ 0,
+ 1,
+ "conversations",
+ "bot_id",
+ "bot_id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ],
+ [
+ 0,
+ 2,
+ "conversations",
+ "user_id",
+ "user_id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ],
+ [1, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"],
+ [2, 0, "bots", "bot_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "conversation_memories",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "title",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "body",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_message_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_run_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "updated_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "expires_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [
+ 2,
+ 0,
+ "conversations",
+ "conversation_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "conversation_memory_commands",
+ "columns": [
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "command_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "request_hash",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "nonce",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "memory_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "operation",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "conversations",
+ "conversation_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "conversation_memory_preferences",
+ "columns": [
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "enabled",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "updated_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "conversations",
+ "conversation_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "conversation_retries",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_bot_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "message_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "idempotency_key",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_json",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "file_plan_json",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "status",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'preparing'",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "error_code",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "error_message",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "updated_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "conversation_thread_requests",
+ "columns": [
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "idempotency_key",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "request_digest",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "conversation_threads",
+ "conversation_id",
+ "conversation_id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [1, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 2,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "conversation_threads",
+ "columns": [
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "parent_conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_message_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_epoch",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_digest",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_context",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "title",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "archived_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "conversations",
+ "parent_conversation_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [
+ 1,
+ 0,
+ "conversations",
+ "conversation_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "conversations",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "bot_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [1, 0, "bots", "bot_id", "id", "NO ACTION", "NO ACTION", "NONE"]
+ ]
+ },
+ {
+ "table": "credentials",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "ciphertext",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"]
+ ]
+ },
+ {
+ "table": "daily_usage",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "day",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "turns",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "device_operations",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "device_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "request",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "status",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "'pending'",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "result",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "expires_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "connected_devices",
+ "device_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "email_challenges",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "email",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "code_hash",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "token_hash",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "expires_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "attempts",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "consumed_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "ready",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "execution_membership_generations",
+ "columns": [
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "generation",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "file_drafts",
+ "columns": [
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "funded_spend",
+ "columns": [
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "run_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "day",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "reserved_micros",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "billed_micros",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "observed_micros",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "unknown",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "kody_account_probe",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "account_fingerprint",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_fingerprint",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "''",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "checked_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "kody_account_reference_catalog",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "account_fingerprint",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "metadata",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "fetched_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "kody_links",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "subject",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "username",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"]
+ ]
+ },
+ {
+ "table": "kody_reference_catalog",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "account_fingerprint",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "metadata",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "fetched_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "refresh_started_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "complete",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "1",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "data_revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "kody_reference_items",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "ordinal",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "payload",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "kody_refresh_claims",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "token_fingerprint",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "claim_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "status",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "lease_until",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "kody_skill_sync",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "account_fingerprint",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "fetched_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "lease_until",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "kody_skill_sync_stage",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "payload",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "kody_skill_versions",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "package_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_skill_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "name",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "description",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "document",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "files",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "updated_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "current",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "local_mail",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "payload",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "email_challenges", "id", "id", "NO ACTION", "CASCADE", "NONE"]
+ ]
+ },
+ {
+ "table": "mcp_account_commands",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "command_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "request_hash",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "nonce",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "receipt",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"]
+ ]
+ },
+ {
+ "table": "mcp_accounts",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "label",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "url",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "auth_mode",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "enabled",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "removed",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "grant_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "token_revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "ciphertext",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "status",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "checked_at",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "error",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "refresh_claim",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "refresh_until",
+ "type": "INTEGER",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "updated_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"]
+ ]
+ },
+ {
+ "table": "mcp_reference_catalog",
+ "columns": [
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "server_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "fingerprint",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "metadata",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "fetched_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "refresh_started_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "memberships",
+ "workspace_id",
+ "workspace_id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ],
+ [
+ 0,
+ 1,
+ "memberships",
+ "user_id",
+ "user_id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "mcp_setup_attempts",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "request_hash",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "status",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "summary",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "ciphertext",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "state_hash",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "browser_hash",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "expires_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [1, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"]
+ ]
+ },
+ {
+ "table": "memberships",
+ "columns": [
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "role",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "oauth_pending",
+ "columns": [
+ {
+ "name": "state",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "payload",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "expires_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "plugin_bindings",
+ "columns": [
+ {
+ "name": "installation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "requirement_key",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "server_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "endpoint",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "plugin_versions",
+ "installation_id",
+ "installation_id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [
+ 0,
+ 1,
+ "plugin_versions",
+ "version",
+ "version",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [
+ 1,
+ 0,
+ "plugin_installations",
+ "installation_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "plugin_commands",
+ "columns": [
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "command_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "request_hash",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "nonce",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "receipt",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "plugin_files",
+ "columns": [
+ {
+ "name": "installation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "path",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "content",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "plugin_versions",
+ "installation_id",
+ "installation_id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [
+ 0,
+ 1,
+ "plugin_versions",
+ "version",
+ "version",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "plugin_installations",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "current_version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "enabled",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "removed",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "updated_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "plugin_skill_identities",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "installation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "path",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "plugin_installations",
+ "installation_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "plugin_skill_versions",
+ "columns": [
+ {
+ "name": "skill_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "document",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "plugin_skill_identities",
+ "skill_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "plugin_versions",
+ "columns": [
+ {
+ "name": "installation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "digest",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "preview",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "plugin_installations",
+ "installation_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "recipes",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "title",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "description",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "code",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "run_usage_receipts",
+ "columns": [
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "run_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "bot_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "scheduled",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "day",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "attempt_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "saved_file_imports",
+ "columns": [
+ {
+ "name": "target_file_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "target_conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source_file_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "sha256",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "name",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "media_type",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "size",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "conversations",
+ "target_conversation_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [1, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 2,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "saved_files",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "bot_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "draft_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "name",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "media_type",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "size",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "sha256",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "source",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "state",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "file_drafts",
+ "workspace_id",
+ "workspace_id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [
+ 0,
+ 1,
+ "file_drafts",
+ "user_id",
+ "user_id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [
+ 0,
+ 2,
+ "file_drafts",
+ "draft_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [
+ 1,
+ 0,
+ "conversations",
+ "conversation_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [2, 0, "bots", "bot_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [3, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 4,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "scheduled_daily_usage",
+ "columns": [
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "day",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "turns",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "sessions",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "expires_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"]
+ ]
+ },
+ {
+ "table": "skill_commands",
+ "columns": [
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "command_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "request_hash",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "nonce",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "receipt",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "skill_versions",
+ "columns": [
+ {
+ "name": "skill_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "document",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "content_hash",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "skills", "skill_id", "id", "NO ACTION", "NO ACTION", "NONE"]
+ ]
+ },
+ {
+ "table": "skills",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "version",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "enabled",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "archived",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "updated_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "thread_schedule_suspensions",
+ "columns": [
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "generation",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "conversation_threads",
+ "conversation_id",
+ "conversation_id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "users",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "username",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "email",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "table": "workflow_children",
+ "columns": [
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "owner_conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "workflow_run_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "step_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "admission_json",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "conversations",
+ "owner_conversation_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ],
+ [
+ 1,
+ 0,
+ "conversations",
+ "conversation_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "workflow_revisions",
+ "columns": [
+ {
+ "name": "conversation_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "workflow_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 3
+ },
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "command_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "request_hash",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "definition_json",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "archived",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "created_at",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "user_id", "id", "NO ACTION", "NO ACTION", "NONE"],
+ [
+ 1,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "NO ACTION",
+ "NONE"
+ ],
+ [
+ 2,
+ 0,
+ "conversations",
+ "conversation_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "workspace_sync_clock",
+ "columns": [
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "1",
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "published_revision",
+ "type": "INTEGER",
+ "notNull": true,
+ "default": "0",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "workspaces",
+ "workspace_id",
+ "id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "workspace_sync_members",
+ "columns": [
+ {
+ "name": "workspace_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "user_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 2
+ },
+ {
+ "name": "generation",
+ "type": "TEXT",
+ "notNull": true,
+ "default": "lower(hex(randomblob(16)))",
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [
+ 0,
+ 0,
+ "memberships",
+ "workspace_id",
+ "workspace_id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ],
+ [
+ 0,
+ 1,
+ "memberships",
+ "user_id",
+ "user_id",
+ "NO ACTION",
+ "CASCADE",
+ "NONE"
+ ]
+ ]
+ },
+ {
+ "table": "workspaces",
+ "columns": [
+ {
+ "name": "id",
+ "type": "TEXT",
+ "notNull": false,
+ "default": null,
+ "primaryKeyPosition": 1
+ },
+ {
+ "name": "owner_id",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "name",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ },
+ {
+ "name": "policy",
+ "type": "TEXT",
+ "notNull": true,
+ "default": null,
+ "primaryKeyPosition": 0
+ }
+ ],
+ "foreignKeys": [
+ [0, 0, "users", "owner_id", "id", "NO ACTION", "NO ACTION", "NONE"]
+ ]
+ }
+ ]
+}
diff --git a/drizzle/migrations/0002_tanchat_account_workspace.sql b/drizzle/migrations/0002_tanchat_account_workspace.sql
new file mode 100644
index 000000000..485206a77
--- /dev/null
+++ b/drizzle/migrations/0002_tanchat_account_workspace.sql
@@ -0,0 +1,47 @@
+CREATE TABLE "chat_bots" (
+ "id" text PRIMARY KEY NOT NULL,
+ "workspace_id" text NOT NULL,
+ "parent_id" text,
+ "name" text NOT NULL,
+ "purpose" text DEFAULT '' NOT NULL,
+ "archived_at" timestamp with time zone,
+ "deleted_at" timestamp with time zone,
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
+ CONSTRAINT "chat_bots_workspace_id_unique" UNIQUE("workspace_id","id"),
+ CONSTRAINT "chat_personal_assistant_active_check" CHECK ("chat_bots"."id" NOT LIKE 'assistant:%' OR ("chat_bots"."archived_at" IS NULL AND "chat_bots"."deleted_at" IS NULL))
+);
+--> statement-breakpoint
+CREATE TABLE "chat_conversations" (
+ "id" text PRIMARY KEY NOT NULL,
+ "bot_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
+ CONSTRAINT "chat_conversation_user_bot" UNIQUE("bot_id","user_id")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_memberships" (
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "role" text NOT NULL,
+ CONSTRAINT "chat_memberships_workspace_id_user_id_pk" PRIMARY KEY("workspace_id","user_id"),
+ CONSTRAINT "chat_memberships_role_check" CHECK ("chat_memberships"."role" IN ('owner', 'admin', 'member'))
+);
+--> statement-breakpoint
+CREATE TABLE "chat_workspaces" (
+ "id" text PRIMARY KEY NOT NULL,
+ "owner_id" uuid NOT NULL,
+ "name" text NOT NULL,
+ "policy" jsonb NOT NULL,
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "chat_bots" ADD CONSTRAINT "chat_bots_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_bots" ADD CONSTRAINT "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk" FOREIGN KEY ("workspace_id","parent_id") REFERENCES "public"."chat_bots"("workspace_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_conversations" ADD CONSTRAINT "chat_conversations_bot_id_chat_bots_id_fk" FOREIGN KEY ("bot_id") REFERENCES "public"."chat_bots"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_conversations" ADD CONSTRAINT "chat_conversations_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_memberships" ADD CONSTRAINT "chat_memberships_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_memberships" ADD CONSTRAINT "chat_memberships_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_workspaces" ADD CONSTRAINT "chat_workspaces_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_bots_workspace_idx" ON "chat_bots" USING btree ("workspace_id");--> statement-breakpoint
+CREATE INDEX "chat_memberships_user_idx" ON "chat_memberships" USING btree ("user_id");--> statement-breakpoint
+CREATE INDEX "chat_workspaces_owner_idx" ON "chat_workspaces" USING btree ("owner_id");
\ No newline at end of file
diff --git a/drizzle/migrations/0003_tanchat_conversation_identity.sql b/drizzle/migrations/0003_tanchat_conversation_identity.sql
new file mode 100644
index 000000000..a9b95d3c5
--- /dev/null
+++ b/drizzle/migrations/0003_tanchat_conversation_identity.sql
@@ -0,0 +1,11 @@
+CREATE TABLE "chat_conversation_mains" (
+ "bot_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "conversation_id" text NOT NULL,
+ CONSTRAINT "chat_conversation_mains_bot_id_user_id_pk" PRIMARY KEY("bot_id","user_id")
+);
+--> statement-breakpoint
+ALTER TABLE "chat_conversations" DROP CONSTRAINT "chat_conversation_user_bot";--> statement-breakpoint
+ALTER TABLE "chat_conversations" ADD CONSTRAINT "chat_conversation_identity" UNIQUE("id","bot_id","user_id");
+--> statement-breakpoint
+ALTER TABLE "chat_conversation_mains" ADD CONSTRAINT "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk" FOREIGN KEY ("conversation_id","bot_id","user_id") REFERENCES "public"."chat_conversations"("id","bot_id","user_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
diff --git a/drizzle/migrations/0004_tanchat_thread_context.sql b/drizzle/migrations/0004_tanchat_thread_context.sql
new file mode 100644
index 000000000..98aca377a
--- /dev/null
+++ b/drizzle/migrations/0004_tanchat_thread_context.sql
@@ -0,0 +1,17 @@
+CREATE TABLE "chat_conversation_threads" (
+ "conversation_id" text PRIMARY KEY NOT NULL,
+ "parent_conversation_id" text NOT NULL,
+ "bot_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "source_message_id" text NOT NULL,
+ "source" jsonb NOT NULL,
+ "title" text NOT NULL,
+ "version" integer DEFAULT 0 NOT NULL,
+ "archived_at" timestamp with time zone,
+ CONSTRAINT "chat_thread_not_self" CHECK ("chat_conversation_threads"."conversation_id" <> "chat_conversation_threads"."parent_conversation_id"),
+ CONSTRAINT "chat_thread_version_nonnegative" CHECK ("chat_conversation_threads"."version" >= 0)
+);
+--> statement-breakpoint
+ALTER TABLE "chat_conversation_threads" ADD CONSTRAINT "chat_thread_child_identity_fk" FOREIGN KEY ("conversation_id","bot_id","user_id") REFERENCES "public"."chat_conversations"("id","bot_id","user_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_conversation_threads" ADD CONSTRAINT "chat_thread_parent_identity_fk" FOREIGN KEY ("parent_conversation_id","bot_id","user_id") REFERENCES "public"."chat_conversations"("id","bot_id","user_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_thread_parent_idx" ON "chat_conversation_threads" USING btree ("parent_conversation_id");
\ No newline at end of file
diff --git a/drizzle/migrations/0005_tanchat_thread_requests.sql b/drizzle/migrations/0005_tanchat_thread_requests.sql
new file mode 100644
index 000000000..8ab1d4cbf
--- /dev/null
+++ b/drizzle/migrations/0005_tanchat_thread_requests.sql
@@ -0,0 +1,13 @@
+CREATE TABLE "chat_thread_requests" (
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "idempotency_key" uuid NOT NULL,
+ "parent_conversation_id" text NOT NULL,
+ "source_message_id" text NOT NULL,
+ "conversation_id" text NOT NULL,
+ CONSTRAINT "chat_thread_requests_workspace_id_user_id_idempotency_key_pk" PRIMARY KEY("workspace_id","user_id","idempotency_key")
+);
+--> statement-breakpoint
+ALTER TABLE "chat_thread_requests" ADD CONSTRAINT "chat_thread_requests_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_thread_requests" ADD CONSTRAINT "chat_thread_requests_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_thread_requests" ADD CONSTRAINT "chat_thread_requests_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE cascade ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0006_tanchat_credentials.sql b/drizzle/migrations/0006_tanchat_credentials.sql
new file mode 100644
index 000000000..150885a6f
--- /dev/null
+++ b/drizzle/migrations/0006_tanchat_credentials.sql
@@ -0,0 +1,6 @@
+CREATE TABLE "chat_credentials" (
+ "user_id" uuid PRIMARY KEY NOT NULL,
+ "ciphertext" text NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "chat_credentials" ADD CONSTRAINT "chat_credentials_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0007_tanchat_account_preferences.sql b/drizzle/migrations/0007_tanchat_account_preferences.sql
new file mode 100644
index 000000000..e36088275
--- /dev/null
+++ b/drizzle/migrations/0007_tanchat_account_preferences.sql
@@ -0,0 +1,11 @@
+CREATE TABLE "chat_account_preferences" (
+ "user_id" uuid PRIMARY KEY NOT NULL,
+ "timezone" text,
+ "revision" bigint DEFAULT 0 NOT NULL,
+ "timezone_confirmed_at" bigint,
+ "response" jsonb,
+ "appearance" jsonb,
+ CONSTRAINT "chat_preferences_revision_safe" CHECK ("chat_account_preferences"."revision" >= 0 AND "chat_account_preferences"."revision" <= 9007199254740991)
+);
+--> statement-breakpoint
+ALTER TABLE "chat_account_preferences" ADD CONSTRAINT "chat_account_preferences_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0008_tanchat_conversation_memory.sql b/drizzle/migrations/0008_tanchat_conversation_memory.sql
new file mode 100644
index 000000000..151a3c930
--- /dev/null
+++ b/drizzle/migrations/0008_tanchat_conversation_memory.sql
@@ -0,0 +1,40 @@
+CREATE TABLE "chat_memories" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "conversation_id" text NOT NULL,
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "revision" bigint NOT NULL,
+ "title" text NOT NULL,
+ "body" text NOT NULL,
+ "source_message_id" text,
+ "source_run_id" text,
+ "created_at" bigint NOT NULL,
+ "updated_at" bigint NOT NULL,
+ "expires_at" bigint
+);
+--> statement-breakpoint
+CREATE TABLE "chat_memory_commands" (
+ "conversation_id" text NOT NULL,
+ "command_id" uuid NOT NULL,
+ "request_hash" text NOT NULL,
+ "memory_id" uuid NOT NULL,
+ "revision" bigint NOT NULL,
+ "operation" text NOT NULL,
+ "completed_at" bigint NOT NULL,
+ CONSTRAINT "chat_memory_commands_conversation_id_command_id_pk" PRIMARY KEY("conversation_id","command_id")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_memory_preferences" (
+ "conversation_id" text PRIMARY KEY NOT NULL,
+ "enabled" boolean NOT NULL,
+ "revision" bigint NOT NULL,
+ "updated_at" bigint NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "chat_memories" ADD CONSTRAINT "chat_memories_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_memories" ADD CONSTRAINT "chat_memories_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_memories" ADD CONSTRAINT "chat_memories_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_memory_commands" ADD CONSTRAINT "chat_memory_commands_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_memory_preferences" ADD CONSTRAINT "chat_memory_preferences_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_memory_scope_idx" ON "chat_memories" USING btree ("conversation_id","id");--> statement-breakpoint
+CREATE INDEX "chat_memory_command_identity_idx" ON "chat_memory_commands" USING btree ("conversation_id","memory_id");
\ No newline at end of file
diff --git a/drizzle/migrations/0009_tanchat_composer_drafts.sql b/drizzle/migrations/0009_tanchat_composer_drafts.sql
new file mode 100644
index 000000000..d020af073
--- /dev/null
+++ b/drizzle/migrations/0009_tanchat_composer_drafts.sql
@@ -0,0 +1,11 @@
+CREATE TABLE "chat_composer_drafts" (
+ "user_id" uuid NOT NULL,
+ "scope" text NOT NULL,
+ "value" text NOT NULL,
+ "revision" bigint NOT NULL,
+ "updated_at" bigint NOT NULL,
+ CONSTRAINT "chat_composer_drafts_user_id_scope_pk" PRIMARY KEY("user_id","scope"),
+ CONSTRAINT "chat_draft_revision_safe" CHECK ("chat_composer_drafts"."revision">0 AND "chat_composer_drafts"."revision"<=9007199254740991)
+);
+--> statement-breakpoint
+ALTER TABLE "chat_composer_drafts" ADD CONSTRAINT "chat_composer_drafts_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0010_tanchat_saved_files.sql b/drizzle/migrations/0010_tanchat_saved_files.sql
new file mode 100644
index 000000000..e0d93b853
--- /dev/null
+++ b/drizzle/migrations/0010_tanchat_saved_files.sql
@@ -0,0 +1,125 @@
+CREATE TABLE "chat_bot_drafts" (
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "id" uuid NOT NULL,
+ "bot_id" text NOT NULL,
+ "conversation_id" text NOT NULL,
+ "file_ids" jsonb DEFAULT '[]'::jsonb NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_bot_drafts_workspace_id_user_id_id_pk" PRIMARY KEY("workspace_id","user_id","id"),
+ CONSTRAINT "chat_bot_draft_attachments" CHECK (jsonb_typeof("chat_bot_drafts"."file_ids")='array' AND jsonb_array_length("chat_bot_drafts"."file_ids")<=5)
+);
+--> statement-breakpoint
+CREATE TABLE "chat_file_drafts" (
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "id" uuid NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_file_drafts_workspace_id_user_id_id_pk" PRIMARY KEY("workspace_id","user_id","id")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_saved_file_imports" (
+ "target_file_id" uuid PRIMARY KEY NOT NULL,
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "target_conversation_id" text NOT NULL,
+ "source_conversation_id" text NOT NULL,
+ "source_file_id" uuid NOT NULL,
+ "sha256" text NOT NULL,
+ "name" text NOT NULL,
+ "media_type" text NOT NULL,
+ "size" integer NOT NULL,
+ "source" text NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_file_import_size" CHECK ("chat_saved_file_imports"."size">=0 AND "chat_saved_file_imports"."size"<=2097152),
+ CONSTRAINT "chat_file_import_digest" CHECK ("chat_saved_file_imports"."sha256" ~ '^[0-9a-f]{64}$'),
+ CONSTRAINT "chat_file_import_source" CHECK ("chat_saved_file_imports"."source" IN ('upload','assistant'))
+);
+--> statement-breakpoint
+CREATE TABLE "chat_saved_files" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "bot_id" text,
+ "conversation_id" text,
+ "draft_id" uuid,
+ "name" text NOT NULL,
+ "media_type" text NOT NULL,
+ "size" integer NOT NULL,
+ "sha256" text NOT NULL,
+ "source" text NOT NULL,
+ "state" text NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_file_scope" CHECK (("chat_saved_files"."draft_id" IS NOT NULL AND "chat_saved_files"."bot_id" IS NULL AND "chat_saved_files"."conversation_id" IS NULL) OR ("chat_saved_files"."draft_id" IS NULL AND "chat_saved_files"."bot_id" IS NOT NULL AND "chat_saved_files"."conversation_id" IS NOT NULL)),
+ CONSTRAINT "chat_file_size" CHECK ("chat_saved_files"."size">=0 AND "chat_saved_files"."size"<=2097152),
+ CONSTRAINT "chat_file_name" CHECK (length("chat_saved_files"."name") BETWEEN 1 AND 180),
+ CONSTRAINT "chat_file_digest" CHECK ("chat_saved_files"."sha256" ~ '^[0-9a-f]{64}$'),
+ CONSTRAINT "chat_file_source" CHECK ("chat_saved_files"."source" IN ('upload','assistant')),
+ CONSTRAINT "chat_file_state" CHECK ("chat_saved_files"."state" IN ('pending','ready'))
+);
+--> statement-breakpoint
+ALTER TABLE "chat_bot_drafts" ADD CONSTRAINT "chat_bot_draft_scope_fk" FOREIGN KEY ("workspace_id","user_id","id") REFERENCES "public"."chat_file_drafts"("workspace_id","user_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_bot_drafts" ADD CONSTRAINT "chat_bot_draft_conversation_fk" FOREIGN KEY ("conversation_id","bot_id","user_id") REFERENCES "public"."chat_conversations"("id","bot_id","user_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_bot_drafts" ADD CONSTRAINT "chat_bot_draft_workspace_fk" FOREIGN KEY ("workspace_id","bot_id") REFERENCES "public"."chat_bots"("workspace_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_file_drafts" ADD CONSTRAINT "chat_file_drafts_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_file_drafts" ADD CONSTRAINT "chat_file_drafts_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_saved_file_imports" ADD CONSTRAINT "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_saved_file_imports" ADD CONSTRAINT "chat_saved_file_imports_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_saved_file_imports" ADD CONSTRAINT "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("target_conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_saved_files" ADD CONSTRAINT "chat_saved_files_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_saved_files" ADD CONSTRAINT "chat_saved_files_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_saved_files" ADD CONSTRAINT "chat_file_draft_fk" FOREIGN KEY ("workspace_id","user_id","draft_id") REFERENCES "public"."chat_file_drafts"("workspace_id","user_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_saved_files" ADD CONSTRAINT "chat_file_conversation_fk" FOREIGN KEY ("conversation_id","bot_id","user_id") REFERENCES "public"."chat_conversations"("id","bot_id","user_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_saved_files" ADD CONSTRAINT "chat_file_workspace_fk" FOREIGN KEY ("workspace_id","bot_id") REFERENCES "public"."chat_bots"("workspace_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_file_import_target_idx" ON "chat_saved_file_imports" USING btree ("workspace_id","user_id","target_conversation_id");--> statement-breakpoint
+CREATE INDEX "chat_file_conversation_idx" ON "chat_saved_files" USING btree ("workspace_id","user_id","conversation_id","created_at","id");--> statement-breakpoint
+CREATE INDEX "chat_file_draft_idx" ON "chat_saved_files" USING btree ("workspace_id","user_id","draft_id","created_at","id");--> statement-breakpoint
+CREATE FUNCTION chat_saved_file_immutable() RETURNS trigger LANGUAGE plpgsql AS $$
+BEGIN
+ IF ROW(NEW.id,NEW.workspace_id,NEW.user_id,NEW.name,NEW.media_type,NEW.size,NEW.sha256,NEW.source,NEW.created_at)
+ IS DISTINCT FROM ROW(OLD.id,OLD.workspace_id,OLD.user_id,OLD.name,OLD.media_type,OLD.size,OLD.sha256,OLD.source,OLD.created_at)
+ OR (OLD.state='ready' AND NEW.state!='ready') THEN
+ RAISE EXCEPTION 'Saved files are immutable.';
+ END IF;
+ IF ROW(NEW.bot_id,NEW.draft_id,NEW.conversation_id) IS DISTINCT FROM ROW(OLD.bot_id,OLD.draft_id,OLD.conversation_id) THEN
+ IF NOT (OLD.bot_id IS NULL AND OLD.conversation_id IS NULL AND OLD.draft_id IS NOT NULL
+ AND NEW.bot_id IS NOT NULL AND NEW.conversation_id IS NOT NULL AND NEW.draft_id IS NULL) THEN
+ RAISE EXCEPTION 'Saved files are immutable.';
+ END IF;
+ PERFORM 1 FROM chat_conversations c JOIN chat_bots b ON b.id=c.bot_id
+ JOIN chat_memberships a ON a.workspace_id=b.workspace_id AND a.user_id=c.user_id
+ WHERE c.id=NEW.conversation_id AND c.bot_id=NEW.bot_id AND c.user_id=NEW.user_id
+ AND b.workspace_id=NEW.workspace_id AND b.archived_at IS NULL AND b.deleted_at IS NULL
+ FOR UPDATE OF c,b,a;
+ IF NOT FOUND OR NOT EXISTS (
+ SELECT 1 FROM chat_bot_drafts d WHERE d.workspace_id=OLD.workspace_id AND d.user_id=OLD.user_id
+ AND d.id=OLD.draft_id AND d.bot_id=NEW.bot_id AND d.conversation_id=NEW.conversation_id
+ AND NOT EXISTS (
+ SELECT 1 FROM jsonb_array_elements(d.file_ids) ref
+ WHERE jsonb_typeof(ref)!='string' OR NOT EXISTS (
+ SELECT 1 FROM chat_saved_files f WHERE f.id::text=ref#>>'{}'
+ AND f.workspace_id=d.workspace_id AND f.user_id=d.user_id AND f.state='ready'
+ AND (f.draft_id=d.id OR f.conversation_id=d.conversation_id)
+ )
+ )
+ ) THEN
+ RAISE EXCEPTION 'Draft files could not be promoted. Check access and retry.';
+ END IF;
+ IF (SELECT count(*) FROM chat_saved_files WHERE workspace_id=NEW.workspace_id AND user_id=NEW.user_id AND conversation_id=NEW.conversation_id)>=100
+ OR (SELECT COALESCE(sum(size),0) FROM chat_saved_files WHERE workspace_id=NEW.workspace_id AND user_id=NEW.user_id AND conversation_id=NEW.conversation_id)+NEW.size>52428800 THEN
+ RAISE EXCEPTION 'The conversation file limit has been reached.';
+ END IF;
+ END IF;
+ RETURN NEW;
+END;
+$$;
+--> statement-breakpoint
+CREATE TRIGGER chat_saved_file_immutable BEFORE UPDATE ON chat_saved_files FOR EACH ROW EXECUTE FUNCTION chat_saved_file_immutable();
+--> statement-breakpoint
+CREATE FUNCTION chat_saved_file_import_immutable() RETURNS trigger LANGUAGE plpgsql AS $$
+BEGIN
+ RAISE EXCEPTION 'File import identities are immutable.';
+END;
+$$;
+--> statement-breakpoint
+CREATE TRIGGER chat_saved_file_import_immutable BEFORE UPDATE ON chat_saved_file_imports FOR EACH ROW EXECUTE FUNCTION chat_saved_file_import_immutable();
diff --git a/drizzle/migrations/0011_tanchat_first_send_receipts.sql b/drizzle/migrations/0011_tanchat_first_send_receipts.sql
new file mode 100644
index 000000000..851a67ca8
--- /dev/null
+++ b/drizzle/migrations/0011_tanchat_first_send_receipts.sql
@@ -0,0 +1,5 @@
+ALTER TABLE "chat_bot_drafts" ADD COLUMN "parent_id" text;--> statement-breakpoint
+ALTER TABLE "chat_bot_drafts" ADD COLUMN "text" text DEFAULT '' NOT NULL;--> statement-breakpoint
+ALTER TABLE "chat_bot_drafts" ADD COLUMN "started_at" bigint;--> statement-breakpoint
+ALTER TABLE "chat_bot_drafts" ADD COLUMN "run_model" jsonb;--> statement-breakpoint
+ALTER TABLE "chat_bot_drafts" ADD COLUMN "reference_inputs" jsonb DEFAULT '[]'::jsonb NOT NULL;
\ No newline at end of file
diff --git a/drizzle/migrations/0012_tanchat_first_send_identity.sql b/drizzle/migrations/0012_tanchat_first_send_identity.sql
new file mode 100644
index 000000000..5307a9b32
--- /dev/null
+++ b/drizzle/migrations/0012_tanchat_first_send_identity.sql
@@ -0,0 +1 @@
+CREATE UNIQUE INDEX "chat_bot_draft_bot_idx" ON "chat_bot_drafts" USING btree ("bot_id");
\ No newline at end of file
diff --git a/drizzle/migrations/0013_tanchat_skills.sql b/drizzle/migrations/0013_tanchat_skills.sql
new file mode 100644
index 000000000..cc7cb87a6
--- /dev/null
+++ b/drizzle/migrations/0013_tanchat_skills.sql
@@ -0,0 +1,40 @@
+CREATE TABLE "chat_skill_commands" (
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "command_id" uuid NOT NULL,
+ "request_hash" text NOT NULL,
+ "receipt" jsonb NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_skill_commands_workspace_id_user_id_command_id_pk" PRIMARY KEY("workspace_id","user_id","command_id")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_skill_versions" (
+ "skill_id" uuid NOT NULL,
+ "version" bigint NOT NULL,
+ "document" jsonb NOT NULL,
+ "content_hash" text NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_skill_versions_skill_id_version_pk" PRIMARY KEY("skill_id","version"),
+ CONSTRAINT "chat_skill_saved_version" CHECK ("chat_skill_versions"."version">0 AND "chat_skill_versions"."version"<=9007199254740991)
+);
+--> statement-breakpoint
+CREATE TABLE "chat_skills" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "version" bigint NOT NULL,
+ "revision" bigint NOT NULL,
+ "enabled" boolean NOT NULL,
+ "archived" boolean NOT NULL,
+ "created_at" bigint NOT NULL,
+ "updated_at" bigint NOT NULL,
+ CONSTRAINT "chat_skill_version" CHECK ("chat_skills"."version">0 AND "chat_skills"."version"<=9007199254740991),
+ CONSTRAINT "chat_skill_revision" CHECK ("chat_skills"."revision">0 AND "chat_skills"."revision"<=9007199254740991)
+);
+--> statement-breakpoint
+ALTER TABLE "chat_skill_commands" ADD CONSTRAINT "chat_skill_commands_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_skill_commands" ADD CONSTRAINT "chat_skill_commands_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_skill_versions" ADD CONSTRAINT "chat_skill_versions_skill_id_chat_skills_id_fk" FOREIGN KEY ("skill_id") REFERENCES "public"."chat_skills"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_skills" ADD CONSTRAINT "chat_skills_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_skills" ADD CONSTRAINT "chat_skills_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_skill_owner_list" ON "chat_skills" USING btree ("workspace_id","user_id","archived","updated_at","id");
\ No newline at end of file
diff --git a/drizzle/migrations/0014_pale_risque.sql b/drizzle/migrations/0014_pale_risque.sql
new file mode 100644
index 000000000..dae29ecd9
--- /dev/null
+++ b/drizzle/migrations/0014_pale_risque.sql
@@ -0,0 +1,10 @@
+CREATE TABLE "chat_kody_refresh_claims" (
+ "user_id" uuid PRIMARY KEY NOT NULL,
+ "token_fingerprint" text NOT NULL,
+ "claim_id" uuid NOT NULL,
+ "status" text NOT NULL,
+ "lease_until" bigint NOT NULL,
+ CONSTRAINT "chat_kody_refresh_status" CHECK ("chat_kody_refresh_claims"."status" IN ('refreshing','completed','needs_auth'))
+);
+--> statement-breakpoint
+ALTER TABLE "chat_kody_refresh_claims" ADD CONSTRAINT "chat_kody_refresh_claims_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0015_married_machine_man.sql b/drizzle/migrations/0015_married_machine_man.sql
new file mode 100644
index 000000000..1a8bac600
--- /dev/null
+++ b/drizzle/migrations/0015_married_machine_man.sql
@@ -0,0 +1,8 @@
+CREATE TABLE "chat_kody_links" (
+ "user_id" uuid PRIMARY KEY NOT NULL,
+ "subject" text NOT NULL,
+ "username" text NOT NULL,
+ CONSTRAINT "chat_kody_links_subject_unique" UNIQUE("subject")
+);
+--> statement-breakpoint
+ALTER TABLE "chat_kody_links" ADD CONSTRAINT "chat_kody_links_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0016_crazy_cable.sql b/drizzle/migrations/0016_crazy_cable.sql
new file mode 100644
index 000000000..f89d915de
--- /dev/null
+++ b/drizzle/migrations/0016_crazy_cable.sql
@@ -0,0 +1,35 @@
+CREATE TABLE "chat_kody_skill_sync" (
+ "user_id" uuid PRIMARY KEY NOT NULL,
+ "account_fingerprint" text NOT NULL,
+ "fetched_at" bigint NOT NULL,
+ "revision" bigint DEFAULT 0 NOT NULL,
+ "lease_until" bigint DEFAULT 0 NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "chat_kody_skill_sync_stage" (
+ "user_id" uuid NOT NULL,
+ "revision" bigint NOT NULL,
+ "id" text NOT NULL,
+ "payload" jsonb NOT NULL,
+ CONSTRAINT "chat_kody_skill_sync_stage_user_id_revision_id_pk" PRIMARY KEY("user_id","revision","id")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_kody_skill_versions" (
+ "user_id" uuid NOT NULL,
+ "id" text NOT NULL,
+ "version" bigint NOT NULL,
+ "package_id" uuid NOT NULL,
+ "source_skill_id" text NOT NULL,
+ "name" text NOT NULL,
+ "description" text NOT NULL,
+ "document" jsonb NOT NULL,
+ "files" jsonb NOT NULL,
+ "updated_at" bigint NOT NULL,
+ "current" boolean NOT NULL,
+ CONSTRAINT "chat_kody_skill_versions_user_id_id_version_pk" PRIMARY KEY("user_id","id","version")
+);
+--> statement-breakpoint
+ALTER TABLE "chat_kody_skill_sync" ADD CONSTRAINT "chat_kody_skill_sync_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_kody_skill_sync_stage" ADD CONSTRAINT "chat_kody_skill_sync_stage_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_kody_skill_versions" ADD CONSTRAINT "chat_kody_skill_versions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_kody_skill_current_idx" ON "chat_kody_skill_versions" USING btree ("user_id","current","name");
\ No newline at end of file
diff --git a/drizzle/migrations/0017_messy_sabretooth.sql b/drizzle/migrations/0017_messy_sabretooth.sql
new file mode 100644
index 000000000..cc31e3702
--- /dev/null
+++ b/drizzle/migrations/0017_messy_sabretooth.sql
@@ -0,0 +1,75 @@
+CREATE TABLE "chat_plugin_bindings" (
+ "installation_id" uuid NOT NULL,
+ "version" bigint NOT NULL,
+ "requirement_key" text NOT NULL,
+ "server_id" text NOT NULL,
+ "endpoint" text NOT NULL,
+ CONSTRAINT "chat_plugin_bindings_installation_id_version_requirement_key_pk" PRIMARY KEY("installation_id","version","requirement_key")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_plugin_commands" (
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "command_id" uuid NOT NULL,
+ "request_hash" text NOT NULL,
+ "receipt" jsonb NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_plugin_commands_workspace_id_user_id_command_id_pk" PRIMARY KEY("workspace_id","user_id","command_id")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_plugin_files" (
+ "installation_id" uuid NOT NULL,
+ "version" bigint NOT NULL,
+ "path" text NOT NULL,
+ "content" text NOT NULL,
+ CONSTRAINT "chat_plugin_files_installation_id_version_path_pk" PRIMARY KEY("installation_id","version","path")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_plugin_installations" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "current_version" bigint NOT NULL,
+ "revision" bigint NOT NULL,
+ "enabled" boolean NOT NULL,
+ "removed" boolean NOT NULL,
+ "created_at" bigint NOT NULL,
+ "updated_at" bigint NOT NULL,
+ CONSTRAINT "chat_plugin_version_positive" CHECK ("chat_plugin_installations"."current_version">0),
+ CONSTRAINT "chat_plugin_revision_positive" CHECK ("chat_plugin_installations"."revision">0)
+);
+--> statement-breakpoint
+CREATE TABLE "chat_plugin_skill_identities" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "installation_id" uuid NOT NULL,
+ "path" text NOT NULL,
+ CONSTRAINT "chat_plugin_skill_path" UNIQUE("installation_id","path")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_plugin_skill_versions" (
+ "skill_id" uuid NOT NULL,
+ "version" bigint NOT NULL,
+ "document" jsonb NOT NULL,
+ CONSTRAINT "chat_plugin_skill_versions_skill_id_version_pk" PRIMARY KEY("skill_id","version")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_plugin_versions" (
+ "installation_id" uuid NOT NULL,
+ "version" bigint NOT NULL,
+ "digest" text NOT NULL,
+ "preview" jsonb NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_plugin_versions_installation_id_version_pk" PRIMARY KEY("installation_id","version"),
+ CONSTRAINT "chat_plugin_saved_version_positive" CHECK ("chat_plugin_versions"."version">0)
+);
+--> statement-breakpoint
+ALTER TABLE "chat_plugin_bindings" ADD CONSTRAINT "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk" FOREIGN KEY ("installation_id","version") REFERENCES "public"."chat_plugin_versions"("installation_id","version") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_plugin_commands" ADD CONSTRAINT "chat_plugin_commands_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_plugin_commands" ADD CONSTRAINT "chat_plugin_commands_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_plugin_files" ADD CONSTRAINT "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk" FOREIGN KEY ("installation_id","version") REFERENCES "public"."chat_plugin_versions"("installation_id","version") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_plugin_installations" ADD CONSTRAINT "chat_plugin_installations_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_plugin_installations" ADD CONSTRAINT "chat_plugin_installations_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_plugin_skill_identities" ADD CONSTRAINT "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk" FOREIGN KEY ("installation_id") REFERENCES "public"."chat_plugin_installations"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_plugin_skill_versions" ADD CONSTRAINT "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk" FOREIGN KEY ("skill_id") REFERENCES "public"."chat_plugin_skill_identities"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_plugin_versions" ADD CONSTRAINT "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk" FOREIGN KEY ("installation_id") REFERENCES "public"."chat_plugin_installations"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_plugin_owner_list" ON "chat_plugin_installations" USING btree ("workspace_id","user_id","removed","updated_at","id");
\ No newline at end of file
diff --git a/drizzle/migrations/0018_large_rawhide_kid.sql b/drizzle/migrations/0018_large_rawhide_kid.sql
new file mode 100644
index 000000000..4a12ebe8a
--- /dev/null
+++ b/drizzle/migrations/0018_large_rawhide_kid.sql
@@ -0,0 +1,37 @@
+CREATE TABLE "chat_mcp_account_commands" (
+ "user_id" uuid NOT NULL,
+ "command_id" uuid NOT NULL,
+ "request_hash" text NOT NULL,
+ "receipt" jsonb NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_mcp_account_commands_user_id_command_id_pk" PRIMARY KEY("user_id","command_id")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_mcp_accounts" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "user_id" uuid NOT NULL,
+ "label" text NOT NULL,
+ "url" text NOT NULL,
+ "auth_mode" text NOT NULL,
+ "enabled" boolean NOT NULL,
+ "removed" boolean NOT NULL,
+ "revision" bigint NOT NULL,
+ "grant_id" uuid NOT NULL,
+ "token_revision" bigint NOT NULL,
+ "ciphertext" text,
+ "status" text NOT NULL,
+ "checked_at" bigint,
+ "error" text,
+ "refresh_claim" uuid,
+ "refresh_until" bigint,
+ "created_at" bigint NOT NULL,
+ "updated_at" bigint NOT NULL,
+ CONSTRAINT "chat_mcp_auth_mode" CHECK ("chat_mcp_accounts"."auth_mode" IN ('none','token','oauth')),
+ CONSTRAINT "chat_mcp_status" CHECK ("chat_mcp_accounts"."status" IN ('configured','checked','needs_auth','error')),
+ CONSTRAINT "chat_mcp_revision" CHECK ("chat_mcp_accounts"."revision">0),
+ CONSTRAINT "chat_mcp_token_revision" CHECK ("chat_mcp_accounts"."token_revision">=0)
+);
+--> statement-breakpoint
+ALTER TABLE "chat_mcp_account_commands" ADD CONSTRAINT "chat_mcp_account_commands_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_mcp_accounts" ADD CONSTRAINT "chat_mcp_accounts_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_mcp_owner" ON "chat_mcp_accounts" USING btree ("user_id","removed","id");
\ No newline at end of file
diff --git a/drizzle/migrations/0019_slow_power_pack.sql b/drizzle/migrations/0019_slow_power_pack.sql
new file mode 100644
index 000000000..4de5f5adf
--- /dev/null
+++ b/drizzle/migrations/0019_slow_power_pack.sql
@@ -0,0 +1,19 @@
+CREATE TABLE "chat_mcp_setup_attempts" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "user_id" uuid NOT NULL,
+ "workspace_id" text NOT NULL,
+ "request_hash" text NOT NULL,
+ "status" text NOT NULL,
+ "summary" jsonb NOT NULL,
+ "ciphertext" text NOT NULL,
+ "state_hash" text,
+ "browser_hash" text,
+ "expires_at" bigint NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_mcp_setup_attempts_state_hash_unique" UNIQUE("state_hash"),
+ CONSTRAINT "chat_mcp_setup_status" CHECK ("chat_mcp_setup_attempts"."status" IN ('review','starting','authorize','complete','failed'))
+);
+--> statement-breakpoint
+ALTER TABLE "chat_mcp_setup_attempts" ADD CONSTRAINT "chat_mcp_setup_attempts_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_mcp_setup_attempts" ADD CONSTRAINT "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_mcp_setup_owner" ON "chat_mcp_setup_attempts" USING btree ("user_id","workspace_id","created_at");
\ No newline at end of file
diff --git a/drizzle/migrations/0020_tranquil_harpoon.sql b/drizzle/migrations/0020_tranquil_harpoon.sql
new file mode 100644
index 000000000..363c113a8
--- /dev/null
+++ b/drizzle/migrations/0020_tranquil_harpoon.sql
@@ -0,0 +1,34 @@
+CREATE TABLE "chat_workflow_revisions" (
+ "conversation_id" text NOT NULL,
+ "workflow_id" uuid NOT NULL,
+ "revision" bigint NOT NULL,
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "command_id" uuid NOT NULL,
+ "request_hash" text NOT NULL,
+ "definition_json" jsonb NOT NULL,
+ "archived" boolean NOT NULL,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_workflow_revisions_conversation_id_workflow_id_revision_pk" PRIMARY KEY("conversation_id","workflow_id","revision"),
+ CONSTRAINT "chat_workflow_revisions_conversation_id_command_id_unique" UNIQUE("conversation_id","command_id"),
+ CONSTRAINT "chat_workflow_revision_positive" CHECK ("chat_workflow_revisions"."revision">0)
+);
+--> statement-breakpoint
+ALTER TABLE "chat_workflow_revisions" ADD CONSTRAINT "chat_workflow_revisions_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_workflow_revisions" ADD CONSTRAINT "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_workflow_revisions" ADD CONSTRAINT "chat_workflow_revisions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;
+CREATE FUNCTION chat_guard_workflow_revision() RETURNS trigger LANGUAGE plpgsql AS $$
+BEGIN
+ IF TG_OP='UPDATE' THEN RAISE EXCEPTION 'Workflow revisions are immutable'; END IF;
+ PERFORM id FROM chat_conversations WHERE id=NEW.conversation_id FOR UPDATE;
+ IF NOT EXISTS (
+ SELECT 1 FROM chat_conversations c JOIN chat_bots b ON b.id=c.bot_id
+ JOIN chat_memberships member ON member.workspace_id=b.workspace_id AND member.user_id=c.user_id
+ WHERE c.id=NEW.conversation_id AND c.user_id=NEW.user_id AND b.workspace_id=NEW.workspace_id
+ AND b.deleted_at IS NULL AND b.archived_at IS NULL
+ AND NOT EXISTS(SELECT 1 FROM chat_conversation_threads t WHERE t.conversation_id=c.id AND t.archived_at IS NOT NULL)
+ ) THEN RAISE EXCEPTION 'Workflow access is unavailable'; END IF;
+ IF NEW.revision<>COALESCE((SELECT MAX(revision) FROM chat_workflow_revisions WHERE conversation_id=NEW.conversation_id AND workflow_id=NEW.workflow_id),0)+1 THEN RAISE EXCEPTION 'Workflow revision must advance once'; END IF;
+ RETURN NEW;
+END $$;
+CREATE TRIGGER chat_workflow_revision_guard BEFORE INSERT OR UPDATE ON chat_workflow_revisions FOR EACH ROW EXECUTE FUNCTION chat_guard_workflow_revision();
diff --git a/drizzle/migrations/0021_even_roulette.sql b/drizzle/migrations/0021_even_roulette.sql
new file mode 100644
index 000000000..fec3946c1
--- /dev/null
+++ b/drizzle/migrations/0021_even_roulette.sql
@@ -0,0 +1,12 @@
+CREATE TABLE "chat_workflow_children" (
+ "conversation_id" text PRIMARY KEY NOT NULL,
+ "owner_conversation_id" text NOT NULL,
+ "workflow_run_id" uuid NOT NULL,
+ "step_id" text NOT NULL,
+ "admission_json" text NOT NULL,
+ CONSTRAINT "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique" UNIQUE("owner_conversation_id","workflow_run_id","step_id"),
+ CONSTRAINT "chat_workflow_child_admission_json" CHECK (jsonb_typeof("chat_workflow_children"."admission_json"::jsonb)='object')
+);
+--> statement-breakpoint
+ALTER TABLE "chat_workflow_children" ADD CONSTRAINT "chat_workflow_children_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_workflow_children" ADD CONSTRAINT "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("owner_conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE cascade ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0022_tricky_texas_twister.sql b/drizzle/migrations/0022_tricky_texas_twister.sql
new file mode 100644
index 000000000..4d5a4f199
--- /dev/null
+++ b/drizzle/migrations/0022_tricky_texas_twister.sql
@@ -0,0 +1,19 @@
+CREATE TABLE "chat_conversation_activity" (
+ "conversation_id" text PRIMARY KEY NOT NULL,
+ "bot_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "status" text NOT NULL,
+ "activity_at" bigint NOT NULL,
+ "event_version" bigint NOT NULL,
+ "read_version" bigint DEFAULT 0 NOT NULL,
+ "preview" text DEFAULT '' NOT NULL,
+ "message_count" bigint DEFAULT 0 NOT NULL,
+ "queued_count" bigint DEFAULT 0 NOT NULL,
+ "queue_paused" boolean DEFAULT false NOT NULL,
+ CONSTRAINT "chat_activity_status" CHECK ("chat_conversation_activity"."status" IN ('idle','running','approval','setup','error','completed'))
+);
+--> statement-breakpoint
+ALTER TABLE "chat_conversation_activity" ADD CONSTRAINT "chat_conversation_activity_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_conversation_activity" ADD CONSTRAINT "chat_conversation_activity_bot_id_chat_bots_id_fk" FOREIGN KEY ("bot_id") REFERENCES "public"."chat_bots"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_conversation_activity" ADD CONSTRAINT "chat_conversation_activity_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_activity_user_time" ON "chat_conversation_activity" USING btree ("user_id","activity_at");
\ No newline at end of file
diff --git a/drizzle/migrations/0023_productive_the_spike.sql b/drizzle/migrations/0023_productive_the_spike.sql
new file mode 100644
index 000000000..800ea6cf3
--- /dev/null
+++ b/drizzle/migrations/0023_productive_the_spike.sql
@@ -0,0 +1,44 @@
+CREATE TABLE "chat_bot_schedule_suspensions" (
+ "bot_id" text PRIMARY KEY NOT NULL,
+ "generation" bigint DEFAULT 0 NOT NULL,
+ CONSTRAINT "chat_bot_generation_safe" CHECK ("chat_bot_schedule_suspensions"."generation" BETWEEN 0 AND 9007199254740991)
+);
+--> statement-breakpoint
+CREATE TABLE "chat_execution_membership_generations" (
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "generation" bigint NOT NULL,
+ CONSTRAINT "chat_execution_membership_generations_workspace_id_user_id_pk" PRIMARY KEY("workspace_id","user_id"),
+ CONSTRAINT "chat_membership_generation_safe" CHECK ("chat_execution_membership_generations"."generation" BETWEEN 0 AND 9007199254740991)
+);
+--> statement-breakpoint
+CREATE TABLE "chat_thread_schedule_suspensions" (
+ "conversation_id" text PRIMARY KEY NOT NULL,
+ "generation" bigint DEFAULT 0 NOT NULL,
+ CONSTRAINT "chat_thread_generation_safe" CHECK ("chat_thread_schedule_suspensions"."generation" BETWEEN 0 AND 9007199254740991)
+);
+--> statement-breakpoint
+ALTER TABLE "chat_bot_schedule_suspensions" ADD CONSTRAINT "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk" FOREIGN KEY ("bot_id") REFERENCES "public"."chat_bots"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_execution_membership_generations" ADD CONSTRAINT "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_execution_membership_generations" ADD CONSTRAINT "chat_execution_membership_generations_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_thread_schedule_suspensions" ADD CONSTRAINT "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversation_threads"("conversation_id") ON DELETE cascade ON UPDATE no action;
+CREATE FUNCTION chat_bump_bot_lifecycle() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN
+ IF (OLD.archived_at IS NULL AND NEW.archived_at IS NOT NULL) OR (OLD.deleted_at IS NULL AND NEW.deleted_at IS NOT NULL) THEN
+ INSERT INTO chat_bot_schedule_suspensions VALUES(NEW.id,1) ON CONFLICT(bot_id) DO UPDATE SET generation=chat_bot_schedule_suspensions.generation+1;
+ END IF; RETURN NEW; END $$;
+CREATE TRIGGER chat_bot_lifecycle AFTER UPDATE OF archived_at,deleted_at ON chat_bots FOR EACH ROW EXECUTE FUNCTION chat_bump_bot_lifecycle();
+CREATE FUNCTION chat_bump_thread_lifecycle() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN
+ IF OLD.archived_at IS NULL AND NEW.archived_at IS NOT NULL THEN
+ INSERT INTO chat_thread_schedule_suspensions VALUES(NEW.conversation_id,1) ON CONFLICT(conversation_id) DO UPDATE SET generation=chat_thread_schedule_suspensions.generation+1;
+ END IF; RETURN NEW; END $$;
+CREATE TRIGGER chat_thread_lifecycle AFTER UPDATE OF archived_at ON chat_conversation_threads FOR EACH ROW EXECUTE FUNCTION chat_bump_thread_lifecycle();
+CREATE FUNCTION chat_bump_membership_lifecycle() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN
+ IF TG_OP IN ('DELETE','UPDATE') THEN
+ INSERT INTO chat_execution_membership_generations VALUES(OLD.workspace_id,OLD.user_id,1) ON CONFLICT(workspace_id,user_id) DO UPDATE SET generation=chat_execution_membership_generations.generation+1;
+ END IF;
+ IF TG_OP='INSERT' OR (TG_OP='UPDATE' AND (OLD.workspace_id,OLD.user_id) IS DISTINCT FROM (NEW.workspace_id,NEW.user_id)) THEN
+ INSERT INTO chat_execution_membership_generations VALUES(NEW.workspace_id,NEW.user_id,1) ON CONFLICT(workspace_id,user_id) DO UPDATE SET generation=chat_execution_membership_generations.generation+1;
+ END IF; RETURN NULL; END $$;
+CREATE TRIGGER chat_membership_lifecycle_insert AFTER INSERT ON chat_memberships FOR EACH ROW EXECUTE FUNCTION chat_bump_membership_lifecycle();
+CREATE TRIGGER chat_membership_lifecycle_delete AFTER DELETE ON chat_memberships FOR EACH ROW EXECUTE FUNCTION chat_bump_membership_lifecycle();
+CREATE TRIGGER chat_membership_lifecycle_update AFTER UPDATE OF workspace_id,user_id,role ON chat_memberships FOR EACH ROW WHEN ((OLD.workspace_id,OLD.user_id,OLD.role) IS DISTINCT FROM (NEW.workspace_id,NEW.user_id,NEW.role)) EXECUTE FUNCTION chat_bump_membership_lifecycle();
diff --git a/drizzle/migrations/0024_worried_dazzler.sql b/drizzle/migrations/0024_worried_dazzler.sql
new file mode 100644
index 000000000..f09390d80
--- /dev/null
+++ b/drizzle/migrations/0024_worried_dazzler.sql
@@ -0,0 +1,39 @@
+CREATE TABLE "chat_conversation_copies" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "source_bot_id" text NOT NULL,
+ "source_conversation_id" text NOT NULL,
+ "target_bot_id" text NOT NULL,
+ "target_conversation_id" text NOT NULL,
+ "idempotency_key" text NOT NULL,
+ "request_digest" text NOT NULL,
+ "kind" text NOT NULL,
+ "boundary_json" jsonb NOT NULL,
+ "name" text NOT NULL,
+ "purpose" text NOT NULL,
+ "parent_id" text,
+ "status" text DEFAULT 'copying' NOT NULL,
+ "phase" text DEFAULT 'export' NOT NULL,
+ "manifest_json" jsonb,
+ "next_page" bigint DEFAULT 0 NOT NULL,
+ "work_version" bigint DEFAULT 0 NOT NULL,
+ "error_code" text,
+ "error_message" text,
+ "attempts" bigint DEFAULT 0 NOT NULL,
+ "retry_at" bigint DEFAULT 0 NOT NULL,
+ "created_at" bigint NOT NULL,
+ "updated_at" bigint NOT NULL,
+ "completed_at" bigint,
+ CONSTRAINT "chat_conversation_copies_target_bot_id_unique" UNIQUE("target_bot_id"),
+ CONSTRAINT "chat_conversation_copies_target_conversation_id_unique" UNIQUE("target_conversation_id"),
+ CONSTRAINT "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique" UNIQUE("workspace_id","user_id","idempotency_key"),
+ CONSTRAINT "chat_copy_kind" CHECK ("chat_conversation_copies"."kind" IN ('duplicate','fork')),
+ CONSTRAINT "chat_copy_status" CHECK ("chat_conversation_copies"."status" IN ('copying','ready','failed')),
+ CONSTRAINT "chat_copy_phase" CHECK ("chat_conversation_copies"."phase" IN ('export','transfer','import','publish','cleanup','done'))
+);
+--> statement-breakpoint
+ALTER TABLE "chat_conversation_copies" ADD CONSTRAINT "chat_conversation_copies_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_conversation_copies" ADD CONSTRAINT "chat_conversation_copies_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_copies_pending" ON "chat_conversation_copies" USING btree ("source_conversation_id","phase","retry_at");--> statement-breakpoint
+CREATE INDEX "chat_copies_viewer" ON "chat_conversation_copies" USING btree ("workspace_id","user_id","created_at");
\ No newline at end of file
diff --git a/drizzle/migrations/0025_crazy_emma_frost.sql b/drizzle/migrations/0025_crazy_emma_frost.sql
new file mode 100644
index 000000000..c5a3f2804
--- /dev/null
+++ b/drizzle/migrations/0025_crazy_emma_frost.sql
@@ -0,0 +1,30 @@
+CREATE TABLE "chat_connected_devices" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "user_id" uuid NOT NULL,
+ "name" text NOT NULL,
+ "token_hash" text NOT NULL,
+ "grants" text DEFAULT '[]' NOT NULL,
+ "last_seen" bigint DEFAULT 0 NOT NULL,
+ "revoked_at" bigint,
+ "created_at" bigint NOT NULL,
+ CONSTRAINT "chat_connected_devices_token_hash_unique" UNIQUE("token_hash")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_device_operations" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "device_id" uuid NOT NULL,
+ "user_id" uuid NOT NULL,
+ "conversation_id" text NOT NULL,
+ "request" text NOT NULL,
+ "status" text DEFAULT 'pending' NOT NULL,
+ "result" text,
+ "created_at" bigint NOT NULL,
+ "expires_at" bigint NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "chat_connected_devices" ADD CONSTRAINT "chat_connected_devices_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_device_operations" ADD CONSTRAINT "chat_device_operations_device_id_chat_connected_devices_id_fk" FOREIGN KEY ("device_id") REFERENCES "public"."chat_connected_devices"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_device_operations" ADD CONSTRAINT "chat_device_operations_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_device_operations" ADD CONSTRAINT "chat_device_operations_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_devices_owner" ON "chat_connected_devices" USING btree ("user_id");--> statement-breakpoint
+CREATE INDEX "chat_device_operations_pending" ON "chat_device_operations" USING btree ("device_id","status","expires_at");
\ No newline at end of file
diff --git a/drizzle/migrations/0026_youthful_maria_hill.sql b/drizzle/migrations/0026_youthful_maria_hill.sql
new file mode 100644
index 000000000..3c0959467
--- /dev/null
+++ b/drizzle/migrations/0026_youthful_maria_hill.sql
@@ -0,0 +1,49 @@
+CREATE TABLE "chat_daily_usage" (
+ "user_id" text NOT NULL,
+ "day" text NOT NULL,
+ "turns" bigint DEFAULT 0 NOT NULL,
+ CONSTRAINT "chat_daily_usage_user_id_day_pk" PRIMARY KEY("user_id","day")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_funded_spend" (
+ "conversation_id" text NOT NULL,
+ "run_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "day" text NOT NULL,
+ "reserved_micros" bigint NOT NULL,
+ "billed_micros" bigint NOT NULL,
+ "observed_micros" bigint DEFAULT 0 NOT NULL,
+ "unknown" boolean DEFAULT false NOT NULL,
+ CONSTRAINT "chat_funded_spend_conversation_id_run_id_pk" PRIMARY KEY("conversation_id","run_id")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_run_usage_receipts" (
+ "conversation_id" text NOT NULL,
+ "run_id" text NOT NULL,
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "bot_id" text NOT NULL,
+ "scheduled" boolean NOT NULL,
+ "day" text NOT NULL,
+ "created_at" bigint NOT NULL,
+ "attempt_id" uuid NOT NULL,
+ CONSTRAINT "chat_run_usage_receipts_conversation_id_run_id_pk" PRIMARY KEY("conversation_id","run_id"),
+ CONSTRAINT "chat_run_usage_receipts_attempt_id_unique" UNIQUE("attempt_id")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_scheduled_daily_usage" (
+ "user_id" uuid NOT NULL,
+ "day" text NOT NULL,
+ "turns" bigint DEFAULT 0 NOT NULL,
+ CONSTRAINT "chat_scheduled_daily_usage_user_id_day_pk" PRIMARY KEY("user_id","day"),
+ CONSTRAINT "chat_scheduled_turns_nonnegative" CHECK ("chat_scheduled_daily_usage"."turns">=0)
+);
+--> statement-breakpoint
+ALTER TABLE "chat_funded_spend" ADD CONSTRAINT "chat_funded_spend_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_funded_spend" ADD CONSTRAINT "chat_funded_spend_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_run_usage_receipts" ADD CONSTRAINT "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_run_usage_receipts" ADD CONSTRAINT "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_run_usage_receipts" ADD CONSTRAINT "chat_run_usage_receipts_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_run_usage_receipts" ADD CONSTRAINT "chat_run_usage_receipts_bot_id_chat_bots_id_fk" FOREIGN KEY ("bot_id") REFERENCES "public"."chat_bots"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_scheduled_daily_usage" ADD CONSTRAINT "chat_scheduled_daily_usage_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_funded_spend_day_user" ON "chat_funded_spend" USING btree ("day","user_id");
\ No newline at end of file
diff --git a/drizzle/migrations/0027_certain_captain_stacy.sql b/drizzle/migrations/0027_certain_captain_stacy.sql
new file mode 100644
index 000000000..0a0d4b791
--- /dev/null
+++ b/drizzle/migrations/0027_certain_captain_stacy.sql
@@ -0,0 +1 @@
+ALTER TABLE "chat_thread_requests" ADD COLUMN "request_digest" text;
\ No newline at end of file
diff --git a/drizzle/migrations/0028_nebulous_songbird.sql b/drizzle/migrations/0028_nebulous_songbird.sql
new file mode 100644
index 000000000..8917b05d2
--- /dev/null
+++ b/drizzle/migrations/0028_nebulous_songbird.sql
@@ -0,0 +1,32 @@
+CREATE TABLE "chat_conversation_retries" (
+ "id" uuid PRIMARY KEY NOT NULL,
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "source_bot_id" text NOT NULL,
+ "source_conversation_id" text NOT NULL,
+ "message_id" text NOT NULL,
+ "idempotency_key" text NOT NULL,
+ "source_json" jsonb NOT NULL,
+ "file_plan_json" jsonb NOT NULL,
+ "status" text DEFAULT 'preparing' NOT NULL,
+ "error_code" text,
+ "error_message" text,
+ "created_at" bigint NOT NULL,
+ "updated_at" bigint NOT NULL,
+ CONSTRAINT "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique" UNIQUE("workspace_id","user_id","idempotency_key"),
+ CONSTRAINT "chat_retry_status" CHECK ("chat_conversation_retries"."status" IN ('preparing','ready','failed'))
+);
+--> statement-breakpoint
+ALTER TABLE "chat_conversation_copies" ADD COLUMN "retry_id" uuid;--> statement-breakpoint
+ALTER TABLE "chat_conversation_retries" ADD CONSTRAINT "chat_conversation_retries_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_conversation_retries" ADD CONSTRAINT "chat_conversation_retries_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_retries_viewer" ON "chat_conversation_retries" USING btree ("workspace_id","user_id","created_at");--> statement-breakpoint
+ALTER TABLE "chat_conversation_copies" ADD CONSTRAINT "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk" FOREIGN KEY ("retry_id") REFERENCES "public"."chat_conversation_retries"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_conversation_copies" ADD CONSTRAINT "chat_conversation_copies_retry_id_unique" UNIQUE("retry_id");--> statement-breakpoint
+CREATE FUNCTION chat_guard_retry_identity() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN RAISE EXCEPTION 'Retry source and input identities are immutable'; END $$;
+--> statement-breakpoint
+CREATE TRIGGER chat_retry_identity_immutable BEFORE UPDATE OF id,workspace_id,user_id,source_bot_id,source_conversation_id,message_id,idempotency_key,source_json,file_plan_json,created_at ON chat_conversation_retries FOR EACH ROW EXECUTE FUNCTION chat_guard_retry_identity();
+--> statement-breakpoint
+CREATE FUNCTION chat_guard_copy_retry_identity() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN RAISE EXCEPTION 'Copy retry identity is immutable'; END $$;
+--> statement-breakpoint
+CREATE TRIGGER chat_copy_retry_immutable BEFORE UPDATE OF retry_id ON chat_conversation_copies FOR EACH ROW EXECUTE FUNCTION chat_guard_copy_retry_identity();
diff --git a/drizzle/migrations/0029_faithful_loa.sql b/drizzle/migrations/0029_faithful_loa.sql
new file mode 100644
index 000000000..009bd5161
--- /dev/null
+++ b/drizzle/migrations/0029_faithful_loa.sql
@@ -0,0 +1,9 @@
+CREATE TABLE "chat_kody_account_reference_catalog" (
+ "user_id" uuid PRIMARY KEY NOT NULL,
+ "account_fingerprint" text NOT NULL,
+ "metadata" text NOT NULL,
+ "fetched_at" bigint NOT NULL,
+ "revision" bigint NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "chat_kody_account_reference_catalog" ADD CONSTRAINT "chat_kody_account_reference_catalog_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0030_last_expediter.sql b/drizzle/migrations/0030_last_expediter.sql
new file mode 100644
index 000000000..78b0abe23
--- /dev/null
+++ b/drizzle/migrations/0030_last_expediter.sql
@@ -0,0 +1,13 @@
+CREATE TABLE "chat_mcp_reference_catalog" (
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "server_id" text NOT NULL,
+ "fingerprint" text NOT NULL,
+ "metadata" text NOT NULL,
+ "fetched_at" bigint NOT NULL,
+ "refresh_started_at" bigint NOT NULL,
+ CONSTRAINT "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk" PRIMARY KEY("workspace_id","user_id","server_id")
+);
+--> statement-breakpoint
+ALTER TABLE "chat_mcp_reference_catalog" ADD CONSTRAINT "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_mcp_reference_catalog" ADD CONSTRAINT "chat_mcp_reference_catalog_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0031_sloppy_mesmero.sql b/drizzle/migrations/0031_sloppy_mesmero.sql
new file mode 100644
index 000000000..12f51950a
--- /dev/null
+++ b/drizzle/migrations/0031_sloppy_mesmero.sql
@@ -0,0 +1,21 @@
+CREATE TABLE "chat_kody_reference_catalog" (
+ "user_id" uuid PRIMARY KEY NOT NULL,
+ "account_fingerprint" text NOT NULL,
+ "metadata" text NOT NULL,
+ "fetched_at" bigint NOT NULL,
+ "complete" boolean DEFAULT false NOT NULL,
+ "data_revision" bigint DEFAULT 0 NOT NULL,
+ "refresh_started_at" bigint NOT NULL,
+ "revision" bigint NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "chat_kody_reference_items" (
+ "user_id" uuid NOT NULL,
+ "revision" bigint NOT NULL,
+ "ordinal" bigint NOT NULL,
+ "payload" jsonb NOT NULL,
+ CONSTRAINT "chat_kody_reference_items_user_id_revision_ordinal_pk" PRIMARY KEY("user_id","revision","ordinal")
+);
+--> statement-breakpoint
+ALTER TABLE "chat_kody_reference_catalog" ADD CONSTRAINT "chat_kody_reference_catalog_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_kody_reference_items" ADD CONSTRAINT "chat_kody_reference_items_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0032_low_jack_murdock.sql b/drizzle/migrations/0032_low_jack_murdock.sql
new file mode 100644
index 000000000..8f7a3add1
--- /dev/null
+++ b/drizzle/migrations/0032_low_jack_murdock.sql
@@ -0,0 +1,9 @@
+CREATE TABLE "chat_kody_account_probe" (
+ "user_id" uuid PRIMARY KEY NOT NULL,
+ "account_fingerprint" text NOT NULL,
+ "source_fingerprint" text DEFAULT '' NOT NULL,
+ "checked_at" bigint NOT NULL,
+ "revision" bigint NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "chat_kody_account_probe" ADD CONSTRAINT "chat_kody_account_probe_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0033_breezy_mister_sinister.sql b/drizzle/migrations/0033_breezy_mister_sinister.sql
new file mode 100644
index 000000000..3365daac2
--- /dev/null
+++ b/drizzle/migrations/0033_breezy_mister_sinister.sql
@@ -0,0 +1,99 @@
+CREATE TABLE "chat_bot_sections" (
+ "id" text PRIMARY KEY NOT NULL,
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "name" text NOT NULL,
+ "position" real DEFAULT 0 NOT NULL,
+ "version" bigint DEFAULT 0 NOT NULL,
+ "sort_override" text
+);
+--> statement-breakpoint
+CREATE TABLE "chat_bot_viewer_state" (
+ "bot_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "pinned" boolean DEFAULT false NOT NULL,
+ "section_id" text,
+ "position" real DEFAULT 0 NOT NULL,
+ "tags" jsonb DEFAULT '[]'::jsonb NOT NULL,
+ CONSTRAINT "chat_bot_viewer_state_bot_id_user_id_pk" PRIMARY KEY("bot_id","user_id")
+);
+--> statement-breakpoint
+CREATE TABLE "chat_workspace_sync_clock" (
+ "workspace_id" text PRIMARY KEY NOT NULL,
+ "revision" bigint DEFAULT 1 NOT NULL,
+ "published_revision" bigint DEFAULT 0 NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "chat_workspace_sync_members" (
+ "workspace_id" text NOT NULL,
+ "user_id" uuid NOT NULL,
+ "generation" uuid DEFAULT gen_random_uuid() NOT NULL,
+ CONSTRAINT "chat_workspace_sync_members_workspace_id_user_id_pk" PRIMARY KEY("workspace_id","user_id")
+);
+--> statement-breakpoint
+ALTER TABLE "chat_bots" ADD COLUMN "version" bigint DEFAULT 0 NOT NULL;--> statement-breakpoint
+ALTER TABLE "chat_bots" ADD COLUMN "avatar" text;--> statement-breakpoint
+ALTER TABLE "chat_bots" ADD COLUMN "deletion_batch" text;--> statement-breakpoint
+ALTER TABLE "chat_bots" ADD COLUMN "updated_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
+ALTER TABLE "chat_bot_sections" ADD CONSTRAINT "chat_bot_sections_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_bot_sections" ADD CONSTRAINT "chat_bot_sections_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_bot_viewer_state" ADD CONSTRAINT "chat_bot_viewer_state_bot_id_chat_bots_id_fk" FOREIGN KEY ("bot_id") REFERENCES "public"."chat_bots"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_bot_viewer_state" ADD CONSTRAINT "chat_bot_viewer_state_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_bot_viewer_state" ADD CONSTRAINT "chat_bot_viewer_state_section_id_chat_bot_sections_id_fk" FOREIGN KEY ("section_id") REFERENCES "public"."chat_bot_sections"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_workspace_sync_clock" ADD CONSTRAINT "chat_workspace_sync_clock_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "chat_workspace_sync_members" ADD CONSTRAINT "chat_workspace_sync_members_workspace_id_user_id_chat_memberships_workspace_id_user_id_fk" FOREIGN KEY ("workspace_id","user_id") REFERENCES "public"."chat_memberships"("workspace_id","user_id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE INDEX "chat_bot_sections_viewer" ON "chat_bot_sections" USING btree ("workspace_id","user_id");
+--> statement-breakpoint
+INSERT INTO chat_workspace_sync_clock(workspace_id) SELECT id FROM chat_workspaces;
+INSERT INTO chat_workspace_sync_members(workspace_id,user_id) SELECT workspace_id,user_id FROM chat_memberships;
+CREATE FUNCTION chat_initialize_workspace_sync() RETURNS trigger LANGUAGE plpgsql AS $$
+BEGIN
+ INSERT INTO chat_workspace_sync_clock(workspace_id) VALUES(NEW.id);
+ RETURN NEW;
+END $$;
+CREATE TRIGGER chat_workspace_sync_initialize AFTER INSERT ON chat_workspaces FOR EACH ROW EXECUTE FUNCTION chat_initialize_workspace_sync();
+CREATE FUNCTION chat_workspace_sync_membership() RETURNS trigger LANGUAGE plpgsql AS $$
+BEGIN
+ IF TG_OP='INSERT' THEN
+ INSERT INTO chat_workspace_sync_members(workspace_id,user_id) VALUES(NEW.workspace_id,NEW.user_id);
+ UPDATE chat_workspace_sync_clock SET revision=revision+1 WHERE workspace_id=NEW.workspace_id;
+ RETURN NEW;
+ END IF;
+ UPDATE chat_workspace_sync_clock SET revision=revision+1 WHERE workspace_id=OLD.workspace_id;
+ RETURN OLD;
+END $$;
+CREATE TRIGGER chat_workspace_sync_member_add AFTER INSERT ON chat_memberships FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_membership();
+CREATE TRIGGER chat_workspace_sync_member_remove BEFORE DELETE ON chat_memberships FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_membership();
+CREATE FUNCTION chat_workspace_sync_dirty() RETURNS trigger LANGUAGE plpgsql AS $$
+DECLARE previous_workspace text; next_workspace text;
+BEGIN
+ IF TG_OP<>'INSERT' THEN
+ IF TG_ARGV[0]='workspace' THEN previous_workspace=to_jsonb(OLD)->>'workspace_id';
+ ELSE SELECT workspace_id INTO previous_workspace FROM chat_bots WHERE id=to_jsonb(OLD)->>'bot_id'; END IF;
+ END IF;
+ IF TG_OP<>'DELETE' THEN
+ IF TG_ARGV[0]='workspace' THEN next_workspace=to_jsonb(NEW)->>'workspace_id';
+ ELSE SELECT workspace_id INTO next_workspace FROM chat_bots WHERE id=to_jsonb(NEW)->>'bot_id'; END IF;
+ END IF;
+ UPDATE chat_workspace_sync_clock SET revision=revision+1 WHERE workspace_id IN(previous_workspace,next_workspace);
+ IF TG_OP='DELETE' THEN RETURN OLD; END IF;
+ RETURN NEW;
+END $$;
+CREATE FUNCTION chat_check_viewer_section() RETURNS trigger LANGUAGE plpgsql AS $$
+BEGIN
+ IF NEW.section_id IS NOT NULL AND NOT EXISTS(SELECT 1 FROM chat_bot_sections s JOIN chat_bots b ON b.workspace_id=s.workspace_id WHERE s.id=NEW.section_id AND s.user_id=NEW.user_id AND b.id=NEW.bot_id) THEN
+ RAISE EXCEPTION 'Section is not available.';
+ END IF;
+ RETURN NEW;
+END $$;
+CREATE TRIGGER chat_viewer_section_guard BEFORE INSERT OR UPDATE OF section_id,bot_id,user_id ON chat_bot_viewer_state FOR EACH ROW EXECUTE FUNCTION chat_check_viewer_section();
+CREATE TRIGGER chat_bots_sync_write AFTER INSERT OR UPDATE ON chat_bots FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_dirty('workspace');
+CREATE TRIGGER chat_bots_sync_delete BEFORE DELETE ON chat_bots FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_dirty('workspace');
+CREATE TRIGGER chat_bot_sections_sync_write AFTER INSERT OR UPDATE ON chat_bot_sections FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_dirty('workspace');
+CREATE TRIGGER chat_bot_sections_sync_delete BEFORE DELETE ON chat_bot_sections FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_dirty('workspace');
+CREATE TRIGGER chat_bot_viewer_state_sync_write AFTER INSERT OR UPDATE ON chat_bot_viewer_state FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_dirty('bot');
+CREATE TRIGGER chat_bot_viewer_state_sync_delete BEFORE DELETE ON chat_bot_viewer_state FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_dirty('bot');
+CREATE TRIGGER chat_conversation_mains_sync_write AFTER INSERT OR UPDATE ON chat_conversation_mains FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_dirty('bot');
+CREATE TRIGGER chat_conversation_mains_sync_delete BEFORE DELETE ON chat_conversation_mains FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_dirty('bot');
+CREATE TRIGGER chat_conversation_activity_sync_write AFTER INSERT OR UPDATE ON chat_conversation_activity FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_dirty('bot');
+CREATE TRIGGER chat_conversation_activity_sync_delete BEFORE DELETE ON chat_conversation_activity FOR EACH ROW EXECUTE FUNCTION chat_workspace_sync_dirty('bot');
diff --git a/drizzle/migrations/0034_tanchat_parent_guards.sql b/drizzle/migrations/0034_tanchat_parent_guards.sql
new file mode 100644
index 000000000..d18c7fbc3
--- /dev/null
+++ b/drizzle/migrations/0034_tanchat_parent_guards.sql
@@ -0,0 +1,40 @@
+-- Ported from Gum migrations/0004_bot_workspace.sql, bots_parent_insert/update.
+-- Serialize hierarchy and parent availability writes within each workspace.
+CREATE FUNCTION chat_bot_hierarchy_lock() RETURNS trigger LANGUAGE plpgsql AS $$
+BEGIN
+ IF TG_OP = 'UPDATE' AND OLD.workspace_id <> NEW.workspace_id THEN
+ PERFORM pg_advisory_xact_lock(hashtextextended('chat-hierarchy:' || least(OLD.workspace_id, NEW.workspace_id), 0));
+ PERFORM pg_advisory_xact_lock(hashtextextended('chat-hierarchy:' || greatest(OLD.workspace_id, NEW.workspace_id), 0));
+ ELSE
+ PERFORM pg_advisory_xact_lock(hashtextextended('chat-hierarchy:' || NEW.workspace_id, 0));
+ END IF;
+ RETURN NEW;
+END;
+$$;
+--> statement-breakpoint
+CREATE TRIGGER chat_bots_00_hierarchy_lock BEFORE INSERT OR UPDATE OF parent_id, workspace_id, archived_at, deleted_at ON chat_bots
+FOR EACH ROW EXECUTE FUNCTION chat_bot_hierarchy_lock();
+--> statement-breakpoint
+CREATE FUNCTION chat_bot_parent_guard() RETURNS trigger LANGUAGE plpgsql AS $$
+BEGIN
+ IF NEW.parent_id IS NULL THEN RETURN NEW; END IF;
+ IF (TG_OP = 'INSERT' AND NEW.parent_id = NEW.id) OR NOT EXISTS (
+ SELECT 1 FROM chat_bots p WHERE p.id=NEW.parent_id AND p.workspace_id=NEW.workspace_id
+ AND p.archived_at IS NULL AND p.deleted_at IS NULL
+ ) THEN
+ RAISE EXCEPTION 'Parent bot is not available in this workspace.' USING ERRCODE='23514';
+ END IF;
+ IF TG_OP = 'UPDATE' AND EXISTS (
+ WITH RECURSIVE ancestors(id, parent_id) AS (
+ SELECT id,parent_id FROM chat_bots WHERE id=NEW.parent_id
+ UNION SELECT b.id,b.parent_id FROM chat_bots b JOIN ancestors a ON b.id=a.parent_id
+ ) SELECT 1 FROM ancestors WHERE id=NEW.id
+ ) THEN
+ RAISE EXCEPTION 'A bot cannot be its own ancestor.' USING ERRCODE='23514';
+ END IF;
+ RETURN NEW;
+END;
+$$;
+--> statement-breakpoint
+CREATE TRIGGER chat_bots_01_parent_guard BEFORE INSERT OR UPDATE OF parent_id, workspace_id ON chat_bots
+FOR EACH ROW EXECUTE FUNCTION chat_bot_parent_guard();
diff --git a/drizzle/migrations/0035_tanchat_saved_actions.sql b/drizzle/migrations/0035_tanchat_saved_actions.sql
new file mode 100644
index 000000000..f15a6f1e4
--- /dev/null
+++ b/drizzle/migrations/0035_tanchat_saved_actions.sql
@@ -0,0 +1,10 @@
+CREATE TABLE "chat_recipes" (
+ "id" text PRIMARY KEY NOT NULL,
+ "workspace_id" text NOT NULL,
+ "title" text NOT NULL,
+ "description" text NOT NULL,
+ "code" text NOT NULL,
+ "created_at" bigint NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "chat_recipes" ADD CONSTRAINT "chat_recipes_workspace_id_chat_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."chat_workspaces"("id") ON DELETE no action ON UPDATE no action;
\ No newline at end of file
diff --git a/drizzle/migrations/0036_tanchat_onboarding.sql b/drizzle/migrations/0036_tanchat_onboarding.sql
new file mode 100644
index 000000000..618e49283
--- /dev/null
+++ b/drizzle/migrations/0036_tanchat_onboarding.sql
@@ -0,0 +1,16 @@
+CREATE TABLE chat_account_onboarding (
+ user_id uuid PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
+ revision bigint NOT NULL DEFAULT 0 CHECK (revision BETWEEN 0 AND 9007199254740991),
+ status text NOT NULL DEFAULT 'pending' CHECK (status IN ('pending','completed','skipped')),
+ use_case text CHECK (use_case IS NULL OR use_case IN ('everyday','work','building')),
+ completed_at bigint CHECK (completed_at IS NULL OR completed_at BETWEEN 0 AND 9007199254740991),
+ CHECK (status != 'pending' OR completed_at IS NULL),
+ CHECK (status != 'completed' OR completed_at IS NOT NULL)
+);
+--> statement-breakpoint
+CREATE TABLE chat_account_onboarding_commands (
+ user_id uuid NOT NULL REFERENCES chat_account_onboarding(user_id) ON DELETE CASCADE,
+ command_id uuid NOT NULL, request_digest text NOT NULL, mutation_id uuid NOT NULL,
+ result_json text NOT NULL CHECK (jsonb_typeof(result_json::jsonb)='object'),
+ PRIMARY KEY(user_id,command_id)
+);
diff --git a/drizzle/migrations/0037_tanchat_kody_oauth.sql b/drizzle/migrations/0037_tanchat_kody_oauth.sql
new file mode 100644
index 000000000..c558d073e
--- /dev/null
+++ b/drizzle/migrations/0037_tanchat_kody_oauth.sql
@@ -0,0 +1,13 @@
+CREATE TABLE "chat_kody_oauth_clients" (
+ "origin" text PRIMARY KEY NOT NULL,
+ "client_id" text NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "chat_kody_oauth_pending" (
+ "state_hash" text PRIMARY KEY NOT NULL,
+ "user_id" uuid NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
+ "payload" text NOT NULL,
+ "expires_at" bigint NOT NULL
+);
+--> statement-breakpoint
+CREATE INDEX "chat_kody_oauth_pending_expiry" ON "chat_kody_oauth_pending" ("expires_at");
diff --git a/drizzle/migrations/0038_tanchat_cascade_lifecycle.sql b/drizzle/migrations/0038_tanchat_cascade_lifecycle.sql
new file mode 100644
index 000000000..1fe3d85fd
--- /dev/null
+++ b/drizzle/migrations/0038_tanchat_cascade_lifecycle.sql
@@ -0,0 +1,36 @@
+CREATE OR REPLACE FUNCTION chat_workspace_sync_membership() RETURNS trigger LANGUAGE plpgsql AS $$
+BEGIN
+ IF TG_OP='INSERT' THEN
+ INSERT INTO chat_workspace_sync_members(workspace_id,user_id) VALUES(NEW.workspace_id,NEW.user_id);
+ UPDATE chat_workspace_sync_clock SET revision=revision+1 WHERE workspace_id=NEW.workspace_id;
+ RETURN NEW;
+ END IF;
+ UPDATE chat_workspace_sync_clock SET revision=revision+1 WHERE workspace_id=OLD.workspace_id AND EXISTS (SELECT 1 FROM chat_workspaces WHERE id=OLD.workspace_id);
+ RETURN OLD;
+END $$;
+
+--> statement-breakpoint
+CREATE OR REPLACE FUNCTION chat_workspace_sync_dirty() RETURNS trigger LANGUAGE plpgsql AS $$
+DECLARE previous_workspace text; next_workspace text;
+BEGIN
+ IF TG_OP<>'INSERT' THEN
+ IF TG_ARGV[0]='workspace' THEN previous_workspace=to_jsonb(OLD)->>'workspace_id';
+ ELSE SELECT workspace_id INTO previous_workspace FROM chat_bots WHERE id=to_jsonb(OLD)->>'bot_id'; END IF;
+ END IF;
+ IF TG_OP<>'DELETE' THEN
+ IF TG_ARGV[0]='workspace' THEN next_workspace=to_jsonb(NEW)->>'workspace_id';
+ ELSE SELECT workspace_id INTO next_workspace FROM chat_bots WHERE id=to_jsonb(NEW)->>'bot_id'; END IF;
+ END IF;
+ UPDATE chat_workspace_sync_clock SET revision=revision+1 WHERE workspace_id IN(previous_workspace,next_workspace) AND EXISTS (SELECT 1 FROM chat_workspaces WHERE id=chat_workspace_sync_clock.workspace_id);
+ IF TG_OP='DELETE' THEN RETURN OLD; END IF;
+ RETURN NEW;
+END $$;
+
+--> statement-breakpoint
+CREATE OR REPLACE FUNCTION chat_bump_membership_lifecycle() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN
+ IF TG_OP IN ('DELETE','UPDATE') AND EXISTS (SELECT 1 FROM chat_workspaces WHERE id=OLD.workspace_id) AND EXISTS (SELECT 1 FROM users WHERE id=OLD.user_id) THEN
+ INSERT INTO chat_execution_membership_generations VALUES(OLD.workspace_id,OLD.user_id,1) ON CONFLICT(workspace_id,user_id) DO UPDATE SET generation=chat_execution_membership_generations.generation+1;
+ END IF;
+ IF TG_OP='INSERT' OR (TG_OP='UPDATE' AND (OLD.workspace_id,OLD.user_id) IS DISTINCT FROM (NEW.workspace_id,NEW.user_id)) THEN
+ INSERT INTO chat_execution_membership_generations VALUES(NEW.workspace_id,NEW.user_id,1) ON CONFLICT(workspace_id,user_id) DO UPDATE SET generation=chat_execution_membership_generations.generation+1;
+ END IF; RETURN NULL; END $$;
diff --git a/drizzle/migrations/0039_tanchat_invites.sql b/drizzle/migrations/0039_tanchat_invites.sql
new file mode 100644
index 000000000..627332f73
--- /dev/null
+++ b/drizzle/migrations/0039_tanchat_invites.sql
@@ -0,0 +1,16 @@
+CREATE TABLE "chat_access" (
+ "user_id" uuid PRIMARY KEY REFERENCES "users"("id") ON DELETE CASCADE,
+ "invited_by" uuid REFERENCES "users"("id") ON DELETE SET NULL,
+ "created_at" timestamptz NOT NULL DEFAULT now()
+);
+--> statement-breakpoint
+CREATE TABLE "chat_invites" (
+ "token_hash" text PRIMARY KEY,
+ "created_by" uuid NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
+ "expires_at" timestamptz NOT NULL,
+ "redeemed_by" uuid REFERENCES "users"("id") ON DELETE SET NULL,
+ "redeemed_at" timestamptz,
+ "created_at" timestamptz NOT NULL DEFAULT now()
+);
+--> statement-breakpoint
+CREATE INDEX "chat_invites_creator_idx" ON "chat_invites" ("created_by");
diff --git a/drizzle/migrations/meta/0002_snapshot.json b/drizzle/migrations/meta/0002_snapshot.json
new file mode 100644
index 000000000..33d99e6e0
--- /dev/null
+++ b/drizzle/migrations/meta/0002_snapshot.json
@@ -0,0 +1,5540 @@
+{
+ "id": "8725d850-ea15-4159-8107-fe15d2448cc4",
+ "prevId": "87b28f50-b9fa-47c9-8230-b2c8121cb3ff",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_user_bot": {
+ "name": "chat_conversation_user_bot",
+ "nullsNotDistinct": false,
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0003_snapshot.json b/drizzle/migrations/meta/0003_snapshot.json
new file mode 100644
index 000000000..4d6f25542
--- /dev/null
+++ b/drizzle/migrations/meta/0003_snapshot.json
@@ -0,0 +1,5586 @@
+{
+ "id": "b21d4ebf-f4e1-4591-a823-7e9a89b31a1b",
+ "prevId": "8725d850-ea15-4159-8107-fe15d2448cc4",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0004_snapshot.json b/drizzle/migrations/meta/0004_snapshot.json
new file mode 100644
index 000000000..ae049a41d
--- /dev/null
+++ b/drizzle/migrations/meta/0004_snapshot.json
@@ -0,0 +1,5698 @@
+{
+ "id": "ab8cc71a-8d67-4dcb-b1d1-78b8a22b3fea",
+ "prevId": "b21d4ebf-f4e1-4591-a823-7e9a89b31a1b",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0005_snapshot.json b/drizzle/migrations/meta/0005_snapshot.json
new file mode 100644
index 000000000..6dfe29f01
--- /dev/null
+++ b/drizzle/migrations/meta/0005_snapshot.json
@@ -0,0 +1,5780 @@
+{
+ "id": "f49a8d24-d551-414a-a1ca-c8d3f51eb542",
+ "prevId": "ab8cc71a-8d67-4dcb-b1d1-78b8a22b3fea",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0006_snapshot.json b/drizzle/migrations/meta/0006_snapshot.json
new file mode 100644
index 000000000..bb60f920d
--- /dev/null
+++ b/drizzle/migrations/meta/0006_snapshot.json
@@ -0,0 +1,5815 @@
+{
+ "id": "d1075f71-b91f-407a-96dc-a4c81b47f1c2",
+ "prevId": "f49a8d24-d551-414a-a1ca-c8d3f51eb542",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0007_snapshot.json b/drizzle/migrations/meta/0007_snapshot.json
new file mode 100644
index 000000000..87dea4753
--- /dev/null
+++ b/drizzle/migrations/meta/0007_snapshot.json
@@ -0,0 +1,5880 @@
+{
+ "id": "42da98f0-ccc9-4aa7-9a06-64296ba8155e",
+ "prevId": "d1075f71-b91f-407a-96dc-a4c81b47f1c2",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0008_snapshot.json b/drizzle/migrations/meta/0008_snapshot.json
new file mode 100644
index 000000000..db053592d
--- /dev/null
+++ b/drizzle/migrations/meta/0008_snapshot.json
@@ -0,0 +1,6154 @@
+{
+ "id": "39cc82aa-5fbd-4d65-84b7-efc1e9dab595",
+ "prevId": "42da98f0-ccc9-4aa7-9a06-64296ba8155e",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0009_snapshot.json b/drizzle/migrations/meta/0009_snapshot.json
new file mode 100644
index 000000000..c05467400
--- /dev/null
+++ b/drizzle/migrations/meta/0009_snapshot.json
@@ -0,0 +1,6217 @@
+{
+ "id": "0dea264a-2771-4347-bc4d-245b4f571485",
+ "prevId": "39cc82aa-5fbd-4d65-84b7-efc1e9dab595",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0010_snapshot.json b/drizzle/migrations/meta/0010_snapshot.json
new file mode 100644
index 000000000..885106ff1
--- /dev/null
+++ b/drizzle/migrations/meta/0010_snapshot.json
@@ -0,0 +1,6767 @@
+{
+ "id": "b763b0cf-26d5-42eb-9873-5204e105c9bd",
+ "prevId": "0dea264a-2771-4347-bc4d-245b4f571485",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0011_snapshot.json b/drizzle/migrations/meta/0011_snapshot.json
new file mode 100644
index 000000000..10bfa19dc
--- /dev/null
+++ b/drizzle/migrations/meta/0011_snapshot.json
@@ -0,0 +1,6799 @@
+{
+ "id": "a31dd577-d8d9-42a2-972b-123f2d7fc8f4",
+ "prevId": "b763b0cf-26d5-42eb-9873-5204e105c9bd",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0012_snapshot.json b/drizzle/migrations/meta/0012_snapshot.json
new file mode 100644
index 000000000..5ab0e9a7b
--- /dev/null
+++ b/drizzle/migrations/meta/0012_snapshot.json
@@ -0,0 +1,6815 @@
+{
+ "id": "6eb7733a-1a98-4462-b805-9c997f5abc71",
+ "prevId": "a31dd577-d8d9-42a2-972b-123f2d7fc8f4",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0013_snapshot.json b/drizzle/migrations/meta/0013_snapshot.json
new file mode 100644
index 000000000..106749501
--- /dev/null
+++ b/drizzle/migrations/meta/0013_snapshot.json
@@ -0,0 +1,7086 @@
+{
+ "id": "7dd28fb7-dafe-4489-b134-13588b2497ef",
+ "prevId": "6eb7733a-1a98-4462-b805-9c997f5abc71",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0014_snapshot.json b/drizzle/migrations/meta/0014_snapshot.json
new file mode 100644
index 000000000..acc024fd1
--- /dev/null
+++ b/drizzle/migrations/meta/0014_snapshot.json
@@ -0,0 +1,7144 @@
+{
+ "id": "813f70cb-0561-4592-8984-3771748f1a6b",
+ "prevId": "7dd28fb7-dafe-4489-b134-13588b2497ef",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0015_snapshot.json b/drizzle/migrations/meta/0015_snapshot.json
new file mode 100644
index 000000000..1103d212d
--- /dev/null
+++ b/drizzle/migrations/meta/0015_snapshot.json
@@ -0,0 +1,7191 @@
+{
+ "id": "6fba936c-00bc-41c9-b066-94df509aa4b1",
+ "prevId": "813f70cb-0561-4592-8984-3771748f1a6b",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0016_snapshot.json b/drizzle/migrations/meta/0016_snapshot.json
new file mode 100644
index 000000000..bfa40ad25
--- /dev/null
+++ b/drizzle/migrations/meta/0016_snapshot.json
@@ -0,0 +1,7420 @@
+{
+ "id": "c095113c-81f1-455e-bc24-b66895daf457",
+ "prevId": "6fba936c-00bc-41c9-b066-94df509aa4b1",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0017_snapshot.json b/drizzle/migrations/meta/0017_snapshot.json
new file mode 100644
index 000000000..4a50ddcfd
--- /dev/null
+++ b/drizzle/migrations/meta/0017_snapshot.json
@@ -0,0 +1,7894 @@
+{
+ "id": "dc6f4e4c-b8de-42e8-afcc-4c91286fc57e",
+ "prevId": "c095113c-81f1-455e-bc24-b66895daf457",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0018_snapshot.json b/drizzle/migrations/meta/0018_snapshot.json
new file mode 100644
index 000000000..d8d62a3b5
--- /dev/null
+++ b/drizzle/migrations/meta/0018_snapshot.json
@@ -0,0 +1,8128 @@
+{
+ "id": "8b50eba4-e7b3-4bfc-9950-9bd580bfdccb",
+ "prevId": "dc6f4e4c-b8de-42e8-afcc-4c91286fc57e",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0019_snapshot.json b/drizzle/migrations/meta/0019_snapshot.json
new file mode 100644
index 000000000..562b95ead
--- /dev/null
+++ b/drizzle/migrations/meta/0019_snapshot.json
@@ -0,0 +1,8265 @@
+{
+ "id": "57b647a2-760a-40f6-82f0-50d7aaaf1127",
+ "prevId": "8b50eba4-e7b3-4bfc-9950-9bd580bfdccb",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0020_snapshot.json b/drizzle/migrations/meta/0020_snapshot.json
new file mode 100644
index 000000000..4902fe2a7
--- /dev/null
+++ b/drizzle/migrations/meta/0020_snapshot.json
@@ -0,0 +1,8382 @@
+{
+ "id": "27518b49-318c-40c3-afc0-d09fc0b6b596",
+ "prevId": "57b647a2-760a-40f6-82f0-50d7aaaf1127",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0021_snapshot.json b/drizzle/migrations/meta/0021_snapshot.json
new file mode 100644
index 000000000..b11897e23
--- /dev/null
+++ b/drizzle/migrations/meta/0021_snapshot.json
@@ -0,0 +1,8455 @@
+{
+ "id": "5163f26d-3e4e-4ece-92d1-291667e19006",
+ "prevId": "27518b49-318c-40c3-afc0-d09fc0b6b596",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0022_snapshot.json b/drizzle/migrations/meta/0022_snapshot.json
new file mode 100644
index 000000000..5b24c4314
--- /dev/null
+++ b/drizzle/migrations/meta/0022_snapshot.json
@@ -0,0 +1,8594 @@
+{
+ "id": "cc357ed8-555d-41f2-91f6-943912cac57e",
+ "prevId": "5163f26d-3e4e-4ece-92d1-291667e19006",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0023_snapshot.json b/drizzle/migrations/meta/0023_snapshot.json
new file mode 100644
index 000000000..b3c9e5331
--- /dev/null
+++ b/drizzle/migrations/meta/0023_snapshot.json
@@ -0,0 +1,8736 @@
+{
+ "id": "a583b08c-383d-44c6-8da1-c9707f2a7216",
+ "prevId": "cc357ed8-555d-41f2-91f6-943912cac57e",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0024_snapshot.json b/drizzle/migrations/meta/0024_snapshot.json
new file mode 100644
index 000000000..f03d0e01a
--- /dev/null
+++ b/drizzle/migrations/meta/0024_snapshot.json
@@ -0,0 +1,9014 @@
+{
+ "id": "90fdb391-0e58-4829-b103-91acbd48ef57",
+ "prevId": "a583b08c-383d-44c6-8da1-c9707f2a7216",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0025_snapshot.json b/drizzle/migrations/meta/0025_snapshot.json
new file mode 100644
index 000000000..41e0c2e9d
--- /dev/null
+++ b/drizzle/migrations/meta/0025_snapshot.json
@@ -0,0 +1,9233 @@
+{
+ "id": "839fa140-432e-4df4-9525-4186f0a48559",
+ "prevId": "90fdb391-0e58-4829-b103-91acbd48ef57",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_connected_devices",
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0026_snapshot.json b/drizzle/migrations/meta/0026_snapshot.json
new file mode 100644
index 000000000..575e51952
--- /dev/null
+++ b/drizzle/migrations/meta/0026_snapshot.json
@@ -0,0 +1,9546 @@
+{
+ "id": "ad3cba20-b3c3-4ce6-a60b-9f087cbb39da",
+ "prevId": "839fa140-432e-4df4-9525-4186f0a48559",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_daily_usage": {
+ "name": "chat_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "chat_daily_usage_user_id_day_pk": {
+ "name": "chat_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_connected_devices",
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_funded_spend": {
+ "name": "chat_funded_spend",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reserved_micros": {
+ "name": "reserved_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "billed_micros": {
+ "name": "billed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "observed_micros": {
+ "name": "observed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unknown": {
+ "name": "unknown",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_funded_spend_day_user": {
+ "name": "chat_funded_spend_day_user",
+ "columns": [
+ {
+ "expression": "day",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_funded_spend_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_funded_spend_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_funded_spend_user_id_users_id_fk": {
+ "name": "chat_funded_spend_user_id_users_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_funded_spend_conversation_id_run_id_pk": {
+ "name": "chat_funded_spend_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_run_usage_receipts": {
+ "name": "chat_run_usage_receipts",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scheduled": {
+ "name": "scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_id": {
+ "name": "attempt_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_user_id_users_id_fk": {
+ "name": "chat_run_usage_receipts_user_id_users_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_bot_id_chat_bots_id_fk": {
+ "name": "chat_run_usage_receipts_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_run_usage_receipts_conversation_id_run_id_pk": {
+ "name": "chat_run_usage_receipts_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_run_usage_receipts_attempt_id_unique": {
+ "name": "chat_run_usage_receipts_attempt_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attempt_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_scheduled_daily_usage": {
+ "name": "chat_scheduled_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_scheduled_daily_usage_user_id_users_id_fk": {
+ "name": "chat_scheduled_daily_usage_user_id_users_id_fk",
+ "tableFrom": "chat_scheduled_daily_usage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_scheduled_daily_usage_user_id_day_pk": {
+ "name": "chat_scheduled_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_scheduled_turns_nonnegative": {
+ "name": "chat_scheduled_turns_nonnegative",
+ "value": "\"chat_scheduled_daily_usage\".\"turns\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0027_snapshot.json b/drizzle/migrations/meta/0027_snapshot.json
new file mode 100644
index 000000000..7c78e9815
--- /dev/null
+++ b/drizzle/migrations/meta/0027_snapshot.json
@@ -0,0 +1,9552 @@
+{
+ "id": "dd62699f-9a34-4088-b42d-7c3bcccd364f",
+ "prevId": "ad3cba20-b3c3-4ce6-a60b-9f087cbb39da",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_daily_usage": {
+ "name": "chat_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "chat_daily_usage_user_id_day_pk": {
+ "name": "chat_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_connected_devices",
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_funded_spend": {
+ "name": "chat_funded_spend",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reserved_micros": {
+ "name": "reserved_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "billed_micros": {
+ "name": "billed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "observed_micros": {
+ "name": "observed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unknown": {
+ "name": "unknown",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_funded_spend_day_user": {
+ "name": "chat_funded_spend_day_user",
+ "columns": [
+ {
+ "expression": "day",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_funded_spend_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_funded_spend_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_funded_spend_user_id_users_id_fk": {
+ "name": "chat_funded_spend_user_id_users_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_funded_spend_conversation_id_run_id_pk": {
+ "name": "chat_funded_spend_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_run_usage_receipts": {
+ "name": "chat_run_usage_receipts",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scheduled": {
+ "name": "scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_id": {
+ "name": "attempt_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_user_id_users_id_fk": {
+ "name": "chat_run_usage_receipts_user_id_users_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_bot_id_chat_bots_id_fk": {
+ "name": "chat_run_usage_receipts_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_run_usage_receipts_conversation_id_run_id_pk": {
+ "name": "chat_run_usage_receipts_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_run_usage_receipts_attempt_id_unique": {
+ "name": "chat_run_usage_receipts_attempt_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attempt_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_scheduled_daily_usage": {
+ "name": "chat_scheduled_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_scheduled_daily_usage_user_id_users_id_fk": {
+ "name": "chat_scheduled_daily_usage_user_id_users_id_fk",
+ "tableFrom": "chat_scheduled_daily_usage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_scheduled_daily_usage_user_id_day_pk": {
+ "name": "chat_scheduled_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_scheduled_turns_nonnegative": {
+ "name": "chat_scheduled_turns_nonnegative",
+ "value": "\"chat_scheduled_daily_usage\".\"turns\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0028_snapshot.json b/drizzle/migrations/meta/0028_snapshot.json
new file mode 100644
index 000000000..be280b7f3
--- /dev/null
+++ b/drizzle/migrations/meta/0028_snapshot.json
@@ -0,0 +1,9728 @@
+{
+ "id": "e7d7920a-39d9-473a-9eaf-e777d651df9d",
+ "prevId": "dd62699f-9a34-4088-b42d-7c3bcccd364f",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "retry_id": {
+ "name": "retry_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk": {
+ "name": "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_conversation_retries",
+ "columnsFrom": ["retry_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_retry_id_unique": {
+ "name": "chat_conversation_copies_retry_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["retry_id"]
+ },
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_retries": {
+ "name": "chat_conversation_retries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_json": {
+ "name": "source_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_plan_json": {
+ "name": "file_plan_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preparing'"
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_retries_viewer": {
+ "name": "chat_retries_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_retries_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_retries_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_retries_user_id_users_id_fk": {
+ "name": "chat_conversation_retries_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_retry_status": {
+ "name": "chat_retry_status",
+ "value": "\"chat_conversation_retries\".\"status\" IN ('preparing','ready','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_daily_usage": {
+ "name": "chat_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "chat_daily_usage_user_id_day_pk": {
+ "name": "chat_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_connected_devices",
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_funded_spend": {
+ "name": "chat_funded_spend",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reserved_micros": {
+ "name": "reserved_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "billed_micros": {
+ "name": "billed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "observed_micros": {
+ "name": "observed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unknown": {
+ "name": "unknown",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_funded_spend_day_user": {
+ "name": "chat_funded_spend_day_user",
+ "columns": [
+ {
+ "expression": "day",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_funded_spend_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_funded_spend_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_funded_spend_user_id_users_id_fk": {
+ "name": "chat_funded_spend_user_id_users_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_funded_spend_conversation_id_run_id_pk": {
+ "name": "chat_funded_spend_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_run_usage_receipts": {
+ "name": "chat_run_usage_receipts",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scheduled": {
+ "name": "scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_id": {
+ "name": "attempt_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_user_id_users_id_fk": {
+ "name": "chat_run_usage_receipts_user_id_users_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_bot_id_chat_bots_id_fk": {
+ "name": "chat_run_usage_receipts_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_run_usage_receipts_conversation_id_run_id_pk": {
+ "name": "chat_run_usage_receipts_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_run_usage_receipts_attempt_id_unique": {
+ "name": "chat_run_usage_receipts_attempt_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attempt_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_scheduled_daily_usage": {
+ "name": "chat_scheduled_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_scheduled_daily_usage_user_id_users_id_fk": {
+ "name": "chat_scheduled_daily_usage_user_id_users_id_fk",
+ "tableFrom": "chat_scheduled_daily_usage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_scheduled_daily_usage_user_id_day_pk": {
+ "name": "chat_scheduled_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_scheduled_turns_nonnegative": {
+ "name": "chat_scheduled_turns_nonnegative",
+ "value": "\"chat_scheduled_daily_usage\".\"turns\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0029_snapshot.json b/drizzle/migrations/meta/0029_snapshot.json
new file mode 100644
index 000000000..23ab5f49d
--- /dev/null
+++ b/drizzle/migrations/meta/0029_snapshot.json
@@ -0,0 +1,9781 @@
+{
+ "id": "04deec28-f3d6-46a7-9ffb-bc9e857616c6",
+ "prevId": "e7d7920a-39d9-473a-9eaf-e777d651df9d",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "retry_id": {
+ "name": "retry_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk": {
+ "name": "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_conversation_retries",
+ "columnsFrom": ["retry_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_retry_id_unique": {
+ "name": "chat_conversation_copies_retry_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["retry_id"]
+ },
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_retries": {
+ "name": "chat_conversation_retries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_json": {
+ "name": "source_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_plan_json": {
+ "name": "file_plan_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preparing'"
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_retries_viewer": {
+ "name": "chat_retries_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_retries_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_retries_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_retries_user_id_users_id_fk": {
+ "name": "chat_conversation_retries_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_retry_status": {
+ "name": "chat_retry_status",
+ "value": "\"chat_conversation_retries\".\"status\" IN ('preparing','ready','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_daily_usage": {
+ "name": "chat_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "chat_daily_usage_user_id_day_pk": {
+ "name": "chat_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_connected_devices",
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_funded_spend": {
+ "name": "chat_funded_spend",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reserved_micros": {
+ "name": "reserved_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "billed_micros": {
+ "name": "billed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "observed_micros": {
+ "name": "observed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unknown": {
+ "name": "unknown",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_funded_spend_day_user": {
+ "name": "chat_funded_spend_day_user",
+ "columns": [
+ {
+ "expression": "day",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_funded_spend_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_funded_spend_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_funded_spend_user_id_users_id_fk": {
+ "name": "chat_funded_spend_user_id_users_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_funded_spend_conversation_id_run_id_pk": {
+ "name": "chat_funded_spend_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_reference_catalog": {
+ "name": "chat_kody_account_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_account_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_run_usage_receipts": {
+ "name": "chat_run_usage_receipts",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scheduled": {
+ "name": "scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_id": {
+ "name": "attempt_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_user_id_users_id_fk": {
+ "name": "chat_run_usage_receipts_user_id_users_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_bot_id_chat_bots_id_fk": {
+ "name": "chat_run_usage_receipts_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_run_usage_receipts_conversation_id_run_id_pk": {
+ "name": "chat_run_usage_receipts_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_run_usage_receipts_attempt_id_unique": {
+ "name": "chat_run_usage_receipts_attempt_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attempt_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_scheduled_daily_usage": {
+ "name": "chat_scheduled_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_scheduled_daily_usage_user_id_users_id_fk": {
+ "name": "chat_scheduled_daily_usage_user_id_users_id_fk",
+ "tableFrom": "chat_scheduled_daily_usage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_scheduled_daily_usage_user_id_day_pk": {
+ "name": "chat_scheduled_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_scheduled_turns_nonnegative": {
+ "name": "chat_scheduled_turns_nonnegative",
+ "value": "\"chat_scheduled_daily_usage\".\"turns\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0030_snapshot.json b/drizzle/migrations/meta/0030_snapshot.json
new file mode 100644
index 000000000..d9af134b3
--- /dev/null
+++ b/drizzle/migrations/meta/0030_snapshot.json
@@ -0,0 +1,9860 @@
+{
+ "id": "e119adc5-21c6-4351-acd1-a2e92066f49d",
+ "prevId": "04deec28-f3d6-46a7-9ffb-bc9e857616c6",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "retry_id": {
+ "name": "retry_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk": {
+ "name": "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_conversation_retries",
+ "columnsFrom": ["retry_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_retry_id_unique": {
+ "name": "chat_conversation_copies_retry_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["retry_id"]
+ },
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_retries": {
+ "name": "chat_conversation_retries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_json": {
+ "name": "source_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_plan_json": {
+ "name": "file_plan_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preparing'"
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_retries_viewer": {
+ "name": "chat_retries_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_retries_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_retries_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_retries_user_id_users_id_fk": {
+ "name": "chat_conversation_retries_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_retry_status": {
+ "name": "chat_retry_status",
+ "value": "\"chat_conversation_retries\".\"status\" IN ('preparing','ready','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_daily_usage": {
+ "name": "chat_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "chat_daily_usage_user_id_day_pk": {
+ "name": "chat_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_connected_devices",
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_funded_spend": {
+ "name": "chat_funded_spend",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reserved_micros": {
+ "name": "reserved_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "billed_micros": {
+ "name": "billed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "observed_micros": {
+ "name": "observed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unknown": {
+ "name": "unknown",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_funded_spend_day_user": {
+ "name": "chat_funded_spend_day_user",
+ "columns": [
+ {
+ "expression": "day",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_funded_spend_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_funded_spend_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_funded_spend_user_id_users_id_fk": {
+ "name": "chat_funded_spend_user_id_users_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_funded_spend_conversation_id_run_id_pk": {
+ "name": "chat_funded_spend_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_reference_catalog": {
+ "name": "chat_kody_account_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_account_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_reference_catalog": {
+ "name": "chat_mcp_reference_catalog",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fingerprint": {
+ "name": "fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_mcp_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk",
+ "columns": ["workspace_id", "user_id", "server_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_run_usage_receipts": {
+ "name": "chat_run_usage_receipts",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scheduled": {
+ "name": "scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_id": {
+ "name": "attempt_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_user_id_users_id_fk": {
+ "name": "chat_run_usage_receipts_user_id_users_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_bot_id_chat_bots_id_fk": {
+ "name": "chat_run_usage_receipts_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_run_usage_receipts_conversation_id_run_id_pk": {
+ "name": "chat_run_usage_receipts_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_run_usage_receipts_attempt_id_unique": {
+ "name": "chat_run_usage_receipts_attempt_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attempt_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_scheduled_daily_usage": {
+ "name": "chat_scheduled_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_scheduled_daily_usage_user_id_users_id_fk": {
+ "name": "chat_scheduled_daily_usage_user_id_users_id_fk",
+ "tableFrom": "chat_scheduled_daily_usage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_scheduled_daily_usage_user_id_day_pk": {
+ "name": "chat_scheduled_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_scheduled_turns_nonnegative": {
+ "name": "chat_scheduled_turns_nonnegative",
+ "value": "\"chat_scheduled_daily_usage\".\"turns\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0031_snapshot.json b/drizzle/migrations/meta/0031_snapshot.json
new file mode 100644
index 000000000..e5099975c
--- /dev/null
+++ b/drizzle/migrations/meta/0031_snapshot.json
@@ -0,0 +1,9985 @@
+{
+ "id": "07ec0d10-c766-4c66-ab90-42ddf65e0c03",
+ "prevId": "e119adc5-21c6-4351-acd1-a2e92066f49d",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "retry_id": {
+ "name": "retry_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk": {
+ "name": "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_conversation_retries",
+ "columnsFrom": ["retry_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_retry_id_unique": {
+ "name": "chat_conversation_copies_retry_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["retry_id"]
+ },
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_retries": {
+ "name": "chat_conversation_retries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_json": {
+ "name": "source_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_plan_json": {
+ "name": "file_plan_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preparing'"
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_retries_viewer": {
+ "name": "chat_retries_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_retries_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_retries_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_retries_user_id_users_id_fk": {
+ "name": "chat_conversation_retries_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_retry_status": {
+ "name": "chat_retry_status",
+ "value": "\"chat_conversation_retries\".\"status\" IN ('preparing','ready','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_daily_usage": {
+ "name": "chat_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "chat_daily_usage_user_id_day_pk": {
+ "name": "chat_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_connected_devices",
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_funded_spend": {
+ "name": "chat_funded_spend",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reserved_micros": {
+ "name": "reserved_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "billed_micros": {
+ "name": "billed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "observed_micros": {
+ "name": "observed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unknown": {
+ "name": "unknown",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_funded_spend_day_user": {
+ "name": "chat_funded_spend_day_user",
+ "columns": [
+ {
+ "expression": "day",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_funded_spend_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_funded_spend_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_funded_spend_user_id_users_id_fk": {
+ "name": "chat_funded_spend_user_id_users_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_funded_spend_conversation_id_run_id_pk": {
+ "name": "chat_funded_spend_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_reference_catalog": {
+ "name": "chat_kody_account_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_account_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_reference_catalog": {
+ "name": "chat_kody_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "complete": {
+ "name": "complete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "data_revision": {
+ "name": "data_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_reference_items": {
+ "name": "chat_kody_reference_items",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ordinal": {
+ "name": "ordinal",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_reference_items_user_id_users_id_fk": {
+ "name": "chat_kody_reference_items_user_id_users_id_fk",
+ "tableFrom": "chat_kody_reference_items",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_reference_items_user_id_revision_ordinal_pk": {
+ "name": "chat_kody_reference_items_user_id_revision_ordinal_pk",
+ "columns": ["user_id", "revision", "ordinal"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_reference_catalog": {
+ "name": "chat_mcp_reference_catalog",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fingerprint": {
+ "name": "fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_mcp_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk",
+ "columns": ["workspace_id", "user_id", "server_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_run_usage_receipts": {
+ "name": "chat_run_usage_receipts",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scheduled": {
+ "name": "scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_id": {
+ "name": "attempt_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_user_id_users_id_fk": {
+ "name": "chat_run_usage_receipts_user_id_users_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_bot_id_chat_bots_id_fk": {
+ "name": "chat_run_usage_receipts_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_run_usage_receipts_conversation_id_run_id_pk": {
+ "name": "chat_run_usage_receipts_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_run_usage_receipts_attempt_id_unique": {
+ "name": "chat_run_usage_receipts_attempt_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attempt_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_scheduled_daily_usage": {
+ "name": "chat_scheduled_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_scheduled_daily_usage_user_id_users_id_fk": {
+ "name": "chat_scheduled_daily_usage_user_id_users_id_fk",
+ "tableFrom": "chat_scheduled_daily_usage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_scheduled_daily_usage_user_id_day_pk": {
+ "name": "chat_scheduled_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_scheduled_turns_nonnegative": {
+ "name": "chat_scheduled_turns_nonnegative",
+ "value": "\"chat_scheduled_daily_usage\".\"turns\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0032_snapshot.json b/drizzle/migrations/meta/0032_snapshot.json
new file mode 100644
index 000000000..e696f7642
--- /dev/null
+++ b/drizzle/migrations/meta/0032_snapshot.json
@@ -0,0 +1,10039 @@
+{
+ "id": "2c5c167f-d435-4e5e-9566-6721a26c47e9",
+ "prevId": "07ec0d10-c766-4c66-ab90-42ddf65e0c03",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "retry_id": {
+ "name": "retry_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk": {
+ "name": "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_conversation_retries",
+ "columnsFrom": ["retry_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_retry_id_unique": {
+ "name": "chat_conversation_copies_retry_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["retry_id"]
+ },
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_retries": {
+ "name": "chat_conversation_retries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_json": {
+ "name": "source_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_plan_json": {
+ "name": "file_plan_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preparing'"
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_retries_viewer": {
+ "name": "chat_retries_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_retries_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_retries_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_retries_user_id_users_id_fk": {
+ "name": "chat_conversation_retries_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_retry_status": {
+ "name": "chat_retry_status",
+ "value": "\"chat_conversation_retries\".\"status\" IN ('preparing','ready','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_daily_usage": {
+ "name": "chat_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "chat_daily_usage_user_id_day_pk": {
+ "name": "chat_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_connected_devices",
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_funded_spend": {
+ "name": "chat_funded_spend",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reserved_micros": {
+ "name": "reserved_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "billed_micros": {
+ "name": "billed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "observed_micros": {
+ "name": "observed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unknown": {
+ "name": "unknown",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_funded_spend_day_user": {
+ "name": "chat_funded_spend_day_user",
+ "columns": [
+ {
+ "expression": "day",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_funded_spend_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_funded_spend_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_funded_spend_user_id_users_id_fk": {
+ "name": "chat_funded_spend_user_id_users_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_funded_spend_conversation_id_run_id_pk": {
+ "name": "chat_funded_spend_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_probe": {
+ "name": "chat_kody_account_probe",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_fingerprint": {
+ "name": "source_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_probe_user_id_users_id_fk": {
+ "name": "chat_kody_account_probe_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_probe",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_reference_catalog": {
+ "name": "chat_kody_account_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_account_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_reference_catalog": {
+ "name": "chat_kody_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "complete": {
+ "name": "complete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "data_revision": {
+ "name": "data_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_reference_items": {
+ "name": "chat_kody_reference_items",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ordinal": {
+ "name": "ordinal",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_reference_items_user_id_users_id_fk": {
+ "name": "chat_kody_reference_items_user_id_users_id_fk",
+ "tableFrom": "chat_kody_reference_items",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_reference_items_user_id_revision_ordinal_pk": {
+ "name": "chat_kody_reference_items_user_id_revision_ordinal_pk",
+ "columns": ["user_id", "revision", "ordinal"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_reference_catalog": {
+ "name": "chat_mcp_reference_catalog",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fingerprint": {
+ "name": "fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_mcp_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk",
+ "columns": ["workspace_id", "user_id", "server_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_run_usage_receipts": {
+ "name": "chat_run_usage_receipts",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scheduled": {
+ "name": "scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_id": {
+ "name": "attempt_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_user_id_users_id_fk": {
+ "name": "chat_run_usage_receipts_user_id_users_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_bot_id_chat_bots_id_fk": {
+ "name": "chat_run_usage_receipts_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_run_usage_receipts_conversation_id_run_id_pk": {
+ "name": "chat_run_usage_receipts_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_run_usage_receipts_attempt_id_unique": {
+ "name": "chat_run_usage_receipts_attempt_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attempt_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_scheduled_daily_usage": {
+ "name": "chat_scheduled_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_scheduled_daily_usage_user_id_users_id_fk": {
+ "name": "chat_scheduled_daily_usage_user_id_users_id_fk",
+ "tableFrom": "chat_scheduled_daily_usage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_scheduled_daily_usage_user_id_day_pk": {
+ "name": "chat_scheduled_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_scheduled_turns_nonnegative": {
+ "name": "chat_scheduled_turns_nonnegative",
+ "value": "\"chat_scheduled_daily_usage\".\"turns\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0033_snapshot.json b/drizzle/migrations/meta/0033_snapshot.json
new file mode 100644
index 000000000..488c16fc1
--- /dev/null
+++ b/drizzle/migrations/meta/0033_snapshot.json
@@ -0,0 +1,10338 @@
+{
+ "id": "49cffc8a-dc26-4934-b24b-0995f0a2e41e",
+ "prevId": "2c5c167f-d435-4e5e-9566-6721a26c47e9",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_sections": {
+ "name": "chat_bot_sections",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sort_override": {
+ "name": "sort_override",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_bot_sections_viewer": {
+ "name": "chat_bot_sections_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_sections_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bot_sections_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bot_sections",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_sections_user_id_users_id_fk": {
+ "name": "chat_bot_sections_user_id_users_id_fk",
+ "tableFrom": "chat_bot_sections",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_viewer_state": {
+ "name": "chat_bot_viewer_state",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned": {
+ "name": "pinned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "section_id": {
+ "name": "section_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "position": {
+ "name": "position",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "tags": {
+ "name": "tags",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_viewer_state_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_viewer_state_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_viewer_state",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bot_viewer_state_user_id_users_id_fk": {
+ "name": "chat_bot_viewer_state_user_id_users_id_fk",
+ "tableFrom": "chat_bot_viewer_state",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_viewer_state_section_id_chat_bot_sections_id_fk": {
+ "name": "chat_bot_viewer_state_section_id_chat_bot_sections_id_fk",
+ "tableFrom": "chat_bot_viewer_state",
+ "tableTo": "chat_bot_sections",
+ "columnsFrom": ["section_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_viewer_state_bot_id_user_id_pk": {
+ "name": "chat_bot_viewer_state_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "avatar": {
+ "name": "avatar",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deletion_batch": {
+ "name": "deletion_batch",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "retry_id": {
+ "name": "retry_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk": {
+ "name": "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_conversation_retries",
+ "columnsFrom": ["retry_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_retry_id_unique": {
+ "name": "chat_conversation_copies_retry_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["retry_id"]
+ },
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_retries": {
+ "name": "chat_conversation_retries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_json": {
+ "name": "source_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_plan_json": {
+ "name": "file_plan_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preparing'"
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_retries_viewer": {
+ "name": "chat_retries_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_retries_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_retries_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_retries_user_id_users_id_fk": {
+ "name": "chat_conversation_retries_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_retry_status": {
+ "name": "chat_retry_status",
+ "value": "\"chat_conversation_retries\".\"status\" IN ('preparing','ready','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_daily_usage": {
+ "name": "chat_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "chat_daily_usage_user_id_day_pk": {
+ "name": "chat_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_connected_devices",
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_funded_spend": {
+ "name": "chat_funded_spend",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reserved_micros": {
+ "name": "reserved_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "billed_micros": {
+ "name": "billed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "observed_micros": {
+ "name": "observed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unknown": {
+ "name": "unknown",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_funded_spend_day_user": {
+ "name": "chat_funded_spend_day_user",
+ "columns": [
+ {
+ "expression": "day",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_funded_spend_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_funded_spend_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_funded_spend_user_id_users_id_fk": {
+ "name": "chat_funded_spend_user_id_users_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_funded_spend_conversation_id_run_id_pk": {
+ "name": "chat_funded_spend_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_probe": {
+ "name": "chat_kody_account_probe",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_fingerprint": {
+ "name": "source_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_probe_user_id_users_id_fk": {
+ "name": "chat_kody_account_probe_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_probe",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_reference_catalog": {
+ "name": "chat_kody_account_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_account_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_reference_catalog": {
+ "name": "chat_kody_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "complete": {
+ "name": "complete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "data_revision": {
+ "name": "data_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_reference_items": {
+ "name": "chat_kody_reference_items",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ordinal": {
+ "name": "ordinal",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_reference_items_user_id_users_id_fk": {
+ "name": "chat_kody_reference_items_user_id_users_id_fk",
+ "tableFrom": "chat_kody_reference_items",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_reference_items_user_id_revision_ordinal_pk": {
+ "name": "chat_kody_reference_items_user_id_revision_ordinal_pk",
+ "columns": ["user_id", "revision", "ordinal"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_reference_catalog": {
+ "name": "chat_mcp_reference_catalog",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fingerprint": {
+ "name": "fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_mcp_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk",
+ "columns": ["workspace_id", "user_id", "server_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_run_usage_receipts": {
+ "name": "chat_run_usage_receipts",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scheduled": {
+ "name": "scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_id": {
+ "name": "attempt_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_user_id_users_id_fk": {
+ "name": "chat_run_usage_receipts_user_id_users_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_bot_id_chat_bots_id_fk": {
+ "name": "chat_run_usage_receipts_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_run_usage_receipts_conversation_id_run_id_pk": {
+ "name": "chat_run_usage_receipts_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_run_usage_receipts_attempt_id_unique": {
+ "name": "chat_run_usage_receipts_attempt_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attempt_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_scheduled_daily_usage": {
+ "name": "chat_scheduled_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_scheduled_daily_usage_user_id_users_id_fk": {
+ "name": "chat_scheduled_daily_usage_user_id_users_id_fk",
+ "tableFrom": "chat_scheduled_daily_usage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_scheduled_daily_usage_user_id_day_pk": {
+ "name": "chat_scheduled_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_scheduled_turns_nonnegative": {
+ "name": "chat_scheduled_turns_nonnegative",
+ "value": "\"chat_scheduled_daily_usage\".\"turns\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspace_sync_clock": {
+ "name": "chat_workspace_sync_clock",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "published_revision": {
+ "name": "published_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workspace_sync_clock_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workspace_sync_clock_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workspace_sync_clock",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspace_sync_members": {
+ "name": "chat_workspace_sync_members",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workspace_sync_members_workspace_id_user_id_chat_memberships_workspace_id_user_id_fk": {
+ "name": "chat_workspace_sync_members_workspace_id_user_id_chat_memberships_workspace_id_user_id_fk",
+ "tableFrom": "chat_workspace_sync_members",
+ "tableTo": "chat_memberships",
+ "columnsFrom": ["workspace_id", "user_id"],
+ "columnsTo": ["workspace_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workspace_sync_members_workspace_id_user_id_pk": {
+ "name": "chat_workspace_sync_members_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0034_snapshot.json b/drizzle/migrations/meta/0034_snapshot.json
new file mode 100644
index 000000000..b058acbd7
--- /dev/null
+++ b/drizzle/migrations/meta/0034_snapshot.json
@@ -0,0 +1,10338 @@
+{
+ "id": "287d11f9-6c76-491c-ade2-fbed0c2ed11a",
+ "prevId": "49cffc8a-dc26-4934-b24b-0995f0a2e41e",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "columnsFrom": ["actor_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "columnsFrom": ["project_id", "owner_id"],
+ "tableTo": "builder_projects",
+ "columnsTo": ["id", "owner_id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "columnsFrom": ["project_id", "thread_id"],
+ "tableTo": "builder_project_threads",
+ "columnsTo": ["project_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "columnsFrom": ["project_id", "revision_id"],
+ "tableTo": "builder_project_revisions",
+ "columnsTo": ["project_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "columnsFrom": ["project_id", "message_id"],
+ "tableTo": "builder_project_messages",
+ "columnsTo": ["project_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "columnsFrom": ["project_id", "run_id"],
+ "tableTo": "builder_project_runs",
+ "columnsTo": ["project_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "columns": ["project_id", "sequence"],
+ "nullsNotDistinct": false
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "columns": ["project_id", "client_event_id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "columnsFrom": ["owner_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "columnsFrom": ["project_id", "owner_id"],
+ "tableTo": "builder_projects",
+ "columnsTo": ["id", "owner_id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "columnsFrom": ["project_id", "thread_id"],
+ "tableTo": "builder_project_threads",
+ "columnsTo": ["project_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "tableTo": "builder_project_runs",
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "columns": ["project_id", "id"],
+ "nullsNotDistinct": false
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "columns": ["project_id", "client_mutation_id"],
+ "nullsNotDistinct": false
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "columns": ["project_id", "thread_id", "position"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "columnsFrom": ["project_id"],
+ "tableTo": "builder_projects",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "columnsFrom": ["project_id", "owner_id"],
+ "tableTo": "builder_projects",
+ "columnsTo": ["id", "owner_id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "tableTo": "builder_project_revisions",
+ "columnsTo": ["project_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "columnsFrom": ["snapshot_hash"],
+ "tableTo": "builder_project_snapshots",
+ "columnsTo": ["hash"],
+ "onUpdate": "no action",
+ "onDelete": "restrict"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "columns": ["project_id", "revision_number"],
+ "nullsNotDistinct": false
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "columns": ["project_id", "id"],
+ "nullsNotDistinct": false
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "columns": ["project_id", "client_mutation_id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "columnsFrom": ["project_id", "owner_id"],
+ "tableTo": "builder_projects",
+ "columnsTo": ["id", "owner_id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id"],
+ "tableTo": "builder_project_threads",
+ "columnsTo": ["project_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "tableTo": "builder_project_revisions",
+ "columnsTo": ["project_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "tableTo": "builder_project_revisions",
+ "columnsTo": ["project_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "columns": ["project_id", "id"],
+ "nullsNotDistinct": false
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "columns": ["project_id", "thread_id", "id"],
+ "nullsNotDistinct": false
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "columns": ["project_id", "client_mutation_id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "columnsFrom": ["owner_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "columnsFrom": ["snapshot_hash"],
+ "tableTo": "builder_project_snapshots",
+ "columnsTo": ["hash"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "columns": ["owner_id", "snapshot_hash"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "columnsFrom": ["project_id", "owner_id"],
+ "tableTo": "builder_projects",
+ "columnsTo": ["id", "owner_id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "columns": ["project_id", "id"],
+ "nullsNotDistinct": false
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "columns": ["project_id", "client_mutation_id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "columnsFrom": ["owner_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "set null"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "columnsFrom": ["project_id"],
+ "tableTo": "builder_projects",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "columnsFrom": ["owner_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "restrict"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "columnsFrom": ["deleted_by_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "set null"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "tableTo": "builder_projects",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "set null"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "columnsFrom": ["snapshot_hash"],
+ "tableTo": "builder_project_snapshots",
+ "columnsTo": ["hash"],
+ "onUpdate": "no action",
+ "onDelete": "restrict"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "columns": ["id", "owner_id"],
+ "nullsNotDistinct": false
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "columns": ["owner_id", "client_mutation_id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "tableTo": "chat_file_drafts",
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "tableTo": "chat_bots",
+ "columnsTo": ["workspace_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "columnsFrom": ["bot_id"],
+ "tableTo": "chat_bots",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_sections": {
+ "name": "chat_bot_sections",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sort_override": {
+ "name": "sort_override",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_bot_sections_viewer": {
+ "name": "chat_bot_sections_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_sections_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bot_sections_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bot_sections",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_bot_sections_user_id_users_id_fk": {
+ "name": "chat_bot_sections_user_id_users_id_fk",
+ "tableFrom": "chat_bot_sections",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_viewer_state": {
+ "name": "chat_bot_viewer_state",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned": {
+ "name": "pinned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "section_id": {
+ "name": "section_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "position": {
+ "name": "position",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "tags": {
+ "name": "tags",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_viewer_state_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_viewer_state_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_viewer_state",
+ "columnsFrom": ["bot_id"],
+ "tableTo": "chat_bots",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_bot_viewer_state_user_id_users_id_fk": {
+ "name": "chat_bot_viewer_state_user_id_users_id_fk",
+ "tableFrom": "chat_bot_viewer_state",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_bot_viewer_state_section_id_chat_bot_sections_id_fk": {
+ "name": "chat_bot_viewer_state_section_id_chat_bot_sections_id_fk",
+ "tableFrom": "chat_bot_viewer_state",
+ "columnsFrom": ["section_id"],
+ "tableTo": "chat_bot_sections",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "set null"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_viewer_state_bot_id_user_id_pk": {
+ "name": "chat_bot_viewer_state_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "avatar": {
+ "name": "avatar",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deletion_batch": {
+ "name": "deletion_batch",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "tableTo": "chat_bots",
+ "columnsTo": ["workspace_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "columns": ["workspace_id", "id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "columns": ["token_hash"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "columnsFrom": ["bot_id"],
+ "tableTo": "chat_bots",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "retry_id": {
+ "name": "retry_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk": {
+ "name": "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "columnsFrom": ["retry_id"],
+ "tableTo": "chat_conversation_retries",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_retry_id_unique": {
+ "name": "chat_conversation_copies_retry_id_unique",
+ "columns": ["retry_id"],
+ "nullsNotDistinct": false
+ },
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "columns": ["target_bot_id"],
+ "nullsNotDistinct": false
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "columns": ["target_conversation_id"],
+ "nullsNotDistinct": false
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "columns": ["workspace_id", "user_id", "idempotency_key"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_retries": {
+ "name": "chat_conversation_retries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_json": {
+ "name": "source_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_plan_json": {
+ "name": "file_plan_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preparing'"
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_retries_viewer": {
+ "name": "chat_retries_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_retries_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_retries_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_conversation_retries_user_id_users_id_fk": {
+ "name": "chat_conversation_retries_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique",
+ "columns": ["workspace_id", "user_id", "idempotency_key"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_retry_status": {
+ "name": "chat_retry_status",
+ "value": "\"chat_conversation_retries\".\"status\" IN ('preparing','ready','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "columnsFrom": ["bot_id"],
+ "tableTo": "chat_bots",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "columns": ["id", "bot_id", "user_id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_daily_usage": {
+ "name": "chat_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "chat_daily_usage_user_id_day_pk": {
+ "name": "chat_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "columnsFrom": ["device_id"],
+ "tableTo": "chat_connected_devices",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_funded_spend": {
+ "name": "chat_funded_spend",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reserved_micros": {
+ "name": "reserved_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "billed_micros": {
+ "name": "billed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "observed_micros": {
+ "name": "observed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unknown": {
+ "name": "unknown",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_funded_spend_day_user": {
+ "name": "chat_funded_spend_day_user",
+ "columns": [
+ {
+ "expression": "day",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_funded_spend_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_funded_spend_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_funded_spend_user_id_users_id_fk": {
+ "name": "chat_funded_spend_user_id_users_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_funded_spend_conversation_id_run_id_pk": {
+ "name": "chat_funded_spend_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_probe": {
+ "name": "chat_kody_account_probe",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_fingerprint": {
+ "name": "source_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_probe_user_id_users_id_fk": {
+ "name": "chat_kody_account_probe_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_probe",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_reference_catalog": {
+ "name": "chat_kody_account_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_account_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_reference_catalog",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "columns": ["subject"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_reference_catalog": {
+ "name": "chat_kody_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "complete": {
+ "name": "complete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "data_revision": {
+ "name": "data_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_reference_catalog",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_reference_items": {
+ "name": "chat_kody_reference_items",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ordinal": {
+ "name": "ordinal",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_reference_items_user_id_users_id_fk": {
+ "name": "chat_kody_reference_items_user_id_users_id_fk",
+ "tableFrom": "chat_kody_reference_items",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_reference_items_user_id_revision_ordinal_pk": {
+ "name": "chat_kody_reference_items_user_id_revision_ordinal_pk",
+ "columns": ["user_id", "revision", "ordinal"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_reference_catalog": {
+ "name": "chat_mcp_reference_catalog",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fingerprint": {
+ "name": "fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_mcp_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_mcp_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk",
+ "columns": ["workspace_id", "user_id", "server_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "columns": ["state_hash"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "columnsFrom": ["installation_id", "version"],
+ "tableTo": "chat_plugin_versions",
+ "columnsTo": ["installation_id", "version"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "columnsFrom": ["installation_id", "version"],
+ "tableTo": "chat_plugin_versions",
+ "columnsTo": ["installation_id", "version"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "columnsFrom": ["installation_id"],
+ "tableTo": "chat_plugin_installations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "columns": ["installation_id", "path"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "columnsFrom": ["skill_id"],
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "columnsFrom": ["installation_id"],
+ "tableTo": "chat_plugin_installations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_run_usage_receipts": {
+ "name": "chat_run_usage_receipts",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scheduled": {
+ "name": "scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_id": {
+ "name": "attempt_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_run_usage_receipts_user_id_users_id_fk": {
+ "name": "chat_run_usage_receipts_user_id_users_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_run_usage_receipts_bot_id_chat_bots_id_fk": {
+ "name": "chat_run_usage_receipts_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "columnsFrom": ["bot_id"],
+ "tableTo": "chat_bots",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_run_usage_receipts_conversation_id_run_id_pk": {
+ "name": "chat_run_usage_receipts_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_run_usage_receipts_attempt_id_unique": {
+ "name": "chat_run_usage_receipts_attempt_id_unique",
+ "columns": ["attempt_id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "columnsFrom": ["target_conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "tableTo": "chat_file_drafts",
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "tableTo": "chat_bots",
+ "columnsTo": ["workspace_id", "id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_scheduled_daily_usage": {
+ "name": "chat_scheduled_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_scheduled_daily_usage_user_id_users_id_fk": {
+ "name": "chat_scheduled_daily_usage_user_id_users_id_fk",
+ "tableFrom": "chat_scheduled_daily_usage",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_scheduled_daily_usage_user_id_day_pk": {
+ "name": "chat_scheduled_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_scheduled_turns_nonnegative": {
+ "name": "chat_scheduled_turns_nonnegative",
+ "value": "\"chat_scheduled_daily_usage\".\"turns\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "columnsFrom": ["skill_id"],
+ "tableTo": "chat_skills",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversation_threads",
+ "columnsTo": ["conversation_id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "columnsFrom": ["owner_conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "columnsFrom": ["conversation_id"],
+ "tableTo": "chat_conversations",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "columns": ["conversation_id", "command_id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspace_sync_clock": {
+ "name": "chat_workspace_sync_clock",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "published_revision": {
+ "name": "published_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workspace_sync_clock_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workspace_sync_clock_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workspace_sync_clock",
+ "columnsFrom": ["workspace_id"],
+ "tableTo": "chat_workspaces",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspace_sync_members": {
+ "name": "chat_workspace_sync_members",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workspace_sync_members_workspace_id_user_id_chat_memberships_workspace_id_user_id_fk": {
+ "name": "chat_workspace_sync_members_workspace_id_user_id_chat_memberships_workspace_id_user_id_fk",
+ "tableFrom": "chat_workspace_sync_members",
+ "columnsFrom": ["workspace_id", "user_id"],
+ "tableTo": "chat_memberships",
+ "columnsTo": ["workspace_id", "user_id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workspace_sync_members_workspace_id_user_id_pk": {
+ "name": "chat_workspace_sync_members_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "columnsFrom": ["owner_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "columnsFrom": ["moderated_by"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "set null"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "columns": ["cache_key"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "name": "intent_package_versions_id_seq",
+ "increment": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "startWith": "1",
+ "cache": "1",
+ "cycle": false,
+ "schema": "public",
+ "type": "always"
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "columnsFrom": ["package_name"],
+ "tableTo": "intent_packages",
+ "columnsTo": ["name"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "name": "intent_skills_id_seq",
+ "increment": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "startWith": "1",
+ "cache": "1",
+ "cycle": false,
+ "schema": "public",
+ "type": "always"
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "columnsFrom": ["package_version_id"],
+ "tableTo": "intent_package_versions",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "columnsFrom": ["content_hash"],
+ "tableTo": "intent_skill_content",
+ "columnsTo": ["content_hash"],
+ "onUpdate": "no action",
+ "onDelete": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "columns": ["key_hash"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "columns": ["token_hash"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "columns": ["code_hash"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "columnsFrom": ["access_token_id"],
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "set null"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "columns": ["token_hash"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "columnsFrom": ["role_id"],
+ "tableTo": "roles",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "columns": ["name"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "columns": ["token"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "columnsFrom": ["showcase_id"],
+ "tableTo": "showcases",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "columns": ["showcase_id", "user_id"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "columnsFrom": ["moderated_by"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "set null"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "columnsFrom": ["user_id"],
+ "tableTo": "users",
+ "columnsTo": ["id"],
+ "onUpdate": "no action",
+ "onDelete": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "with": {},
+ "method": "btree",
+ "concurrently": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "columns": ["email"],
+ "nullsNotDistinct": false
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "views": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/0035_snapshot.json b/drizzle/migrations/meta/0035_snapshot.json
new file mode 100644
index 000000000..122d558da
--- /dev/null
+++ b/drizzle/migrations/meta/0035_snapshot.json
@@ -0,0 +1,10397 @@
+{
+ "id": "8afd535d-44a9-41c6-b88f-9db03563080f",
+ "prevId": "287d11f9-6c76-491c-ade2-fbed0c2ed11a",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_logs": {
+ "name": "audit_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "audit_action",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "audit_logs_actor_id_idx": {
+ "name": "audit_logs_actor_id_idx",
+ "columns": [
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_action_idx": {
+ "name": "audit_logs_action_idx",
+ "columns": [
+ {
+ "expression": "action",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_type_idx": {
+ "name": "audit_logs_target_type_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_target_id_idx": {
+ "name": "audit_logs_target_id_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_logs_created_at_idx": {
+ "name": "audit_logs_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_logs_actor_id_users_id_fk": {
+ "name": "audit_logs_actor_id_users_id_fk",
+ "tableFrom": "audit_logs",
+ "tableTo": "users",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_events": {
+ "name": "builder_project_events",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_event_id": {
+ "name": "client_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_session_id": {
+ "name": "browser_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "builder_project_event_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "occurred_at": {
+ "name": "occurred_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()"
+ }
+ },
+ "indexes": {
+ "builder_project_events_project_created_at_idx": {
+ "name": "builder_project_events_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_run_sequence_idx": {
+ "name": "builder_project_events_run_sequence_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_events_client_mutation_idx": {
+ "name": "builder_project_events_client_mutation_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_mutation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_events_project_owner_fk": {
+ "name": "builder_project_events_project_owner_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_thread_fk": {
+ "name": "builder_project_events_thread_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_revision_fk": {
+ "name": "builder_project_events_revision_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_message_fk": {
+ "name": "builder_project_events_message_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_messages",
+ "columnsFrom": ["project_id", "message_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_events_run_fk": {
+ "name": "builder_project_events_run_fk",
+ "tableFrom": "builder_project_events",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "run_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_events_project_sequence_unique": {
+ "name": "builder_project_events_project_sequence_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "sequence"]
+ },
+ "builder_project_events_project_client_event_unique": {
+ "name": "builder_project_events_project_client_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_event_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_events_sequence_check": {
+ "name": "builder_project_events_sequence_check",
+ "value": "\"builder_project_events\".\"sequence\" BETWEEN 1 AND 9007199254740991"
+ },
+ "builder_project_events_payload_check": {
+ "name": "builder_project_events_payload_check",
+ "value": "jsonb_typeof(\"builder_project_events\".\"payload\") = 'object' AND pg_column_size(\"builder_project_events\".\"payload\") <= 262144"
+ },
+ "builder_project_events_entity_reference_check": {
+ "name": "builder_project_events_entity_reference_check",
+ "value": "((\"builder_project_events\".\"type\"::text NOT LIKE 'revision.%') OR \"builder_project_events\".\"revision_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'thread.%') OR \"builder_project_events\".\"thread_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'message.%') OR \"builder_project_events\".\"message_id\" IS NOT NULL)\n AND ((\"builder_project_events\".\"type\"::text NOT LIKE 'run.%') OR \"builder_project_events\".\"run_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_legacy_imports": {
+ "name": "builder_project_legacy_imports",
+ "schema": "",
+ "columns": {
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_legacy_imports_owner_id_users_id_fk": {
+ "name": "builder_project_legacy_imports_owner_id_users_id_fk",
+ "tableFrom": "builder_project_legacy_imports",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_messages": {
+ "name": "builder_project_messages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "builder_message_role",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parts": {
+ "name": "parts",
+ "type": "jsonb",
+ "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": {
+ "builder_project_messages_project_thread_created_at_idx": {
+ "name": "builder_project_messages_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_messages_run_id_idx": {
+ "name": "builder_project_messages_run_id_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_messages_project_owner_fk": {
+ "name": "builder_project_messages_project_owner_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_thread_fk": {
+ "name": "builder_project_messages_thread_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_messages_run_fk": {
+ "name": "builder_project_messages_run_fk",
+ "tableFrom": "builder_project_messages",
+ "tableTo": "builder_project_runs",
+ "columnsFrom": ["project_id", "thread_id", "run_id"],
+ "columnsTo": ["project_id", "thread_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_messages_project_id_unique": {
+ "name": "builder_project_messages_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_messages_project_mutation_unique": {
+ "name": "builder_project_messages_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ },
+ "builder_project_messages_thread_position_unique": {
+ "name": "builder_project_messages_thread_position_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "position"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_messages_parts_check": {
+ "name": "builder_project_messages_parts_check",
+ "value": "jsonb_typeof(\"builder_project_messages\".\"parts\") = 'array' AND pg_column_size(\"builder_project_messages\".\"parts\") <= 1048576"
+ },
+ "builder_project_messages_content_size_check": {
+ "name": "builder_project_messages_content_size_check",
+ "value": "octet_length(\"builder_project_messages\".\"content\") <= 1048576"
+ },
+ "builder_project_messages_position_check": {
+ "name": "builder_project_messages_position_check",
+ "value": "\"builder_project_messages\".\"position\" BETWEEN 1 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_mutation_receipts": {
+ "name": "builder_project_mutation_receipts",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_type": {
+ "name": "command_type",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "builder_project_mutation_receipts_project_fk": {
+ "name": "builder_project_mutation_receipts_project_fk",
+ "tableFrom": "builder_project_mutation_receipts",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "builder_project_mutation_receipts_pk": {
+ "name": "builder_project_mutation_receipts_pk",
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_mutation_receipts_command_type_check": {
+ "name": "builder_project_mutation_receipts_command_type_check",
+ "value": "\"builder_project_mutation_receipts\".\"command_type\" IN ('project.create', 'project.revise', 'project.delete', 'thread.create', 'run.enqueue', 'run.claim', 'run.cancel', 'run.finish', 'run.finish.fallback', 'transcript.import')"
+ },
+ "builder_project_mutation_receipts_request_hash_check": {
+ "name": "builder_project_mutation_receipts_request_hash_check",
+ "value": "\"builder_project_mutation_receipts\".\"request_hash\" ~ '^[a-f0-9]{64}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_revisions": {
+ "name": "builder_project_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_revision_id": {
+ "name": "parent_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_number": {
+ "name": "revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_revisions_project_created_at_idx": {
+ "name": "builder_project_revisions_project_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_revisions_snapshot_hash_idx": {
+ "name": "builder_project_revisions_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_revisions_project_owner_fk": {
+ "name": "builder_project_revisions_project_owner_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_parent_fk": {
+ "name": "builder_project_revisions_parent_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "parent_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_revisions_snapshot_hash_fk": {
+ "name": "builder_project_revisions_snapshot_hash_fk",
+ "tableFrom": "builder_project_revisions",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_revisions_project_revision_unique": {
+ "name": "builder_project_revisions_project_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "revision_number"]
+ },
+ "builder_project_revisions_project_id_unique": {
+ "name": "builder_project_revisions_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_revisions_project_mutation_unique": {
+ "name": "builder_project_revisions_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_revisions_snapshot_hash_check": {
+ "name": "builder_project_revisions_snapshot_hash_check",
+ "value": "\"builder_project_revisions\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_revisions_revision_number_check": {
+ "name": "builder_project_revisions_revision_number_check",
+ "value": "\"builder_project_revisions\".\"revision_number\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_runs": {
+ "name": "builder_project_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "builder_run_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "queue_kind": {
+ "name": "queue_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queue'"
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "model": {
+ "name": "model",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "base_revision_id": {
+ "name": "base_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_revision_id": {
+ "name": "result_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner_id": {
+ "name": "lease_owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_fencing_token": {
+ "name": "lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_heartbeat_at": {
+ "name": "last_heartbeat_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity": {
+ "name": "activity",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "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": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "builder_project_runs_project_thread_created_at_idx": {
+ "name": "builder_project_runs_project_thread_created_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_lease_idx": {
+ "name": "builder_project_runs_active_lease_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_runs_active_project_unique": {
+ "name": "builder_project_runs_active_project_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"builder_project_runs\".\"status\" = 'running'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_runs_project_owner_fk": {
+ "name": "builder_project_runs_project_owner_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_thread_fk": {
+ "name": "builder_project_runs_thread_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_threads",
+ "columnsFrom": ["project_id", "thread_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_base_revision_fk": {
+ "name": "builder_project_runs_base_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "base_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_runs_result_revision_fk": {
+ "name": "builder_project_runs_result_revision_fk",
+ "tableFrom": "builder_project_runs",
+ "tableTo": "builder_project_revisions",
+ "columnsFrom": ["project_id", "result_revision_id"],
+ "columnsTo": ["project_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_runs_project_id_unique": {
+ "name": "builder_project_runs_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_runs_project_thread_id_unique": {
+ "name": "builder_project_runs_project_thread_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "thread_id", "id"]
+ },
+ "builder_project_runs_project_mutation_unique": {
+ "name": "builder_project_runs_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_runs_queue_kind_check": {
+ "name": "builder_project_runs_queue_kind_check",
+ "value": "\"builder_project_runs\".\"queue_kind\" IN ('queue', 'steer')"
+ },
+ "builder_project_runs_fencing_token_check": {
+ "name": "builder_project_runs_fencing_token_check",
+ "value": "\"builder_project_runs\".\"lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_project_runs_lease_pair_check": {
+ "name": "builder_project_runs_lease_pair_check",
+ "value": "(\"builder_project_runs\".\"lease_owner_id\" IS NULL) = (\"builder_project_runs\".\"lease_expires_at\" IS NULL)"
+ },
+ "builder_project_runs_running_lease_check": {
+ "name": "builder_project_runs_running_lease_check",
+ "value": "(\"builder_project_runs\".\"status\" = 'running') = (\"builder_project_runs\".\"lease_owner_id\" IS NOT NULL)"
+ },
+ "builder_project_runs_terminal_state_check": {
+ "name": "builder_project_runs_terminal_state_check",
+ "value": "(\"builder_project_runs\".\"status\" IN ('interrupted', 'completed', 'failed', 'cancelled')) = (\"builder_project_runs\".\"completed_at\" IS NOT NULL)"
+ },
+ "builder_project_runs_timestamp_order_check": {
+ "name": "builder_project_runs_timestamp_order_check",
+ "value": "\"builder_project_runs\".\"completed_at\" IS NULL OR \"builder_project_runs\".\"started_at\" IS NULL OR \"builder_project_runs\".\"completed_at\" >= \"builder_project_runs\".\"started_at\""
+ },
+ "builder_project_runs_activity_size_check": {
+ "name": "builder_project_runs_activity_size_check",
+ "value": "\"builder_project_runs\".\"activity\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"activity\") = 'object' AND pg_column_size(\"builder_project_runs\".\"activity\") <= 262144)"
+ },
+ "builder_project_runs_error_size_check": {
+ "name": "builder_project_runs_error_size_check",
+ "value": "\"builder_project_runs\".\"error\" IS NULL OR (jsonb_typeof(\"builder_project_runs\".\"error\") = 'object' AND pg_column_size(\"builder_project_runs\".\"error\") <= 262144)"
+ },
+ "builder_project_runs_result_revision_check": {
+ "name": "builder_project_runs_result_revision_check",
+ "value": "\"builder_project_runs\".\"result_revision_id\" IS NULL OR \"builder_project_runs\".\"status\" = 'completed'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshot_reservations": {
+ "name": "builder_project_snapshot_reservations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "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": {
+ "builder_project_snapshot_reservations_owner_created_at_idx": {
+ "name": "builder_project_snapshot_reservations_owner_created_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_idx": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_idx",
+ "columns": [
+ {
+ "expression": "snapshot_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_snapshot_reservations_owner_id_users_id_fk": {
+ "name": "builder_project_snapshot_reservations_owner_id_users_id_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk": {
+ "name": "builder_project_snapshot_reservations_snapshot_hash_builder_project_snapshots_hash_fk",
+ "tableFrom": "builder_project_snapshot_reservations",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_snapshot_reservations_owner_snapshot_unique": {
+ "name": "builder_project_snapshot_reservations_owner_snapshot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "snapshot_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_snapshots": {
+ "name": "builder_project_snapshots",
+ "schema": "",
+ "columns": {
+ "hash": {
+ "name": "hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_bytes": {
+ "name": "source_bytes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stored_at": {
+ "name": "stored_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleting_at": {
+ "name": "deleting_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quarantined_at": {
+ "name": "quarantined_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": {
+ "builder_project_snapshots_stored_at_idx": {
+ "name": "builder_project_snapshots_stored_at_idx",
+ "columns": [
+ {
+ "expression": "stored_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_snapshots_hash_check": {
+ "name": "builder_project_snapshots_hash_check",
+ "value": "\"builder_project_snapshots\".\"hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_project_snapshots_source_bytes_check": {
+ "name": "builder_project_snapshots_source_bytes_check",
+ "value": "\"builder_project_snapshots\".\"source_bytes\" IS NULL OR \"builder_project_snapshots\".\"source_bytes\" BETWEEN 1 AND 1048576"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_threads": {
+ "name": "builder_project_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_message_position": {
+ "name": "last_message_position",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "builder_project_threads_project_updated_at_idx": {
+ "name": "builder_project_threads_project_updated_at_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_threads_project_owner_fk": {
+ "name": "builder_project_threads_project_owner_fk",
+ "tableFrom": "builder_project_threads",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id", "owner_id"],
+ "columnsTo": ["id", "owner_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_project_threads_project_id_unique": {
+ "name": "builder_project_threads_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "id"]
+ },
+ "builder_project_threads_project_mutation_unique": {
+ "name": "builder_project_threads_project_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_threads_message_position_check": {
+ "name": "builder_project_threads_message_position_check",
+ "value": "\"builder_project_threads\".\"last_message_position\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_project_tombstones": {
+ "name": "builder_project_tombstones",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "builder_project_tombstones_owner_deleted_at_idx": {
+ "name": "builder_project_tombstones_owner_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_project_tombstones_owner_id_users_id_fk": {
+ "name": "builder_project_tombstones_owner_id_users_id_fk",
+ "tableFrom": "builder_project_tombstones",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.builder_project_usage": {
+ "name": "builder_project_usage",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "threads": {
+ "name": "threads",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "messages": {
+ "name": "messages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "runs": {
+ "name": "runs",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revisions": {
+ "name": "revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "events": {
+ "name": "events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "payload_bytes": {
+ "name": "payload_bytes",
+ "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": {
+ "builder_project_usage_project_id_builder_projects_id_fk": {
+ "name": "builder_project_usage_project_id_builder_projects_id_fk",
+ "tableFrom": "builder_project_usage",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "builder_project_usage_nonnegative_check": {
+ "name": "builder_project_usage_nonnegative_check",
+ "value": "\"builder_project_usage\".\"threads\" >= 0 AND \"builder_project_usage\".\"messages\" >= 0 AND \"builder_project_usage\".\"runs\" >= 0 AND \"builder_project_usage\".\"revisions\" >= 0 AND \"builder_project_usage\".\"events\" >= 0 AND \"builder_project_usage\".\"payload_bytes\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.builder_projects": {
+ "name": "builder_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_mutation_id": {
+ "name": "client_mutation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "forked_from_id": {
+ "name": "forked_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(160)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "snapshot_hash": {
+ "name": "snapshot_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision_number": {
+ "name": "current_revision_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "last_event_sequence": {
+ "name": "last_event_sequence",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_lease_fencing_token": {
+ "name": "last_lease_fencing_token",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_id": {
+ "name": "deleted_by_id",
+ "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": {
+ "builder_projects_owner_id_idx": {
+ "name": "builder_projects_owner_id_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_owner_updated_at_idx": {
+ "name": "builder_projects_owner_updated_at_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "builder_projects_deleted_at_idx": {
+ "name": "builder_projects_deleted_at_idx",
+ "columns": [
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "builder_projects_owner_id_users_id_fk": {
+ "name": "builder_projects_owner_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "builder_projects_deleted_by_id_users_id_fk": {
+ "name": "builder_projects_deleted_by_id_users_id_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "users",
+ "columnsFrom": ["deleted_by_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_forked_from_fk": {
+ "name": "builder_projects_forked_from_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_projects",
+ "columnsFrom": ["forked_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "builder_projects_snapshot_hash_fk": {
+ "name": "builder_projects_snapshot_hash_fk",
+ "tableFrom": "builder_projects",
+ "tableTo": "builder_project_snapshots",
+ "columnsFrom": ["snapshot_hash"],
+ "columnsTo": ["hash"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "builder_projects_id_owner_unique": {
+ "name": "builder_projects_id_owner_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "owner_id"]
+ },
+ "builder_projects_owner_mutation_unique": {
+ "name": "builder_projects_owner_mutation_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_id", "client_mutation_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "builder_projects_snapshot_hash_check": {
+ "name": "builder_projects_snapshot_hash_check",
+ "value": "\"builder_projects\".\"snapshot_hash\" ~ '^[a-f0-9]{64}$'"
+ },
+ "builder_projects_revision_number_check": {
+ "name": "builder_projects_revision_number_check",
+ "value": "\"builder_projects\".\"current_revision_number\" > 0"
+ },
+ "builder_projects_event_sequence_check": {
+ "name": "builder_projects_event_sequence_check",
+ "value": "\"builder_projects\".\"last_event_sequence\" BETWEEN 0 AND 9007199254740991"
+ },
+ "builder_projects_lease_fencing_token_check": {
+ "name": "builder_projects_lease_fencing_token_check",
+ "value": "\"builder_projects\".\"last_lease_fencing_token\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_account_preferences": {
+ "name": "chat_account_preferences",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "timezone_confirmed_at": {
+ "name": "timezone_confirmed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response": {
+ "name": "response",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "appearance": {
+ "name": "appearance",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_account_preferences_user_id_users_id_fk": {
+ "name": "chat_account_preferences_user_id_users_id_fk",
+ "tableFrom": "chat_account_preferences",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_preferences_revision_safe": {
+ "name": "chat_preferences_revision_safe",
+ "value": "\"chat_account_preferences\".\"revision\" >= 0 AND \"chat_account_preferences\".\"revision\" <= 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_drafts": {
+ "name": "chat_bot_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_model": {
+ "name": "run_model",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_inputs": {
+ "name": "reference_inputs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "file_ids": {
+ "name": "file_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_bot_draft_bot_idx": {
+ "name": "chat_bot_draft_bot_idx",
+ "columns": [
+ {
+ "expression": "bot_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_draft_scope_fk": {
+ "name": "chat_bot_draft_scope_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_conversation_fk": {
+ "name": "chat_bot_draft_conversation_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_draft_workspace_fk": {
+ "name": "chat_bot_draft_workspace_fk",
+ "tableFrom": "chat_bot_drafts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_bot_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_draft_attachments": {
+ "name": "chat_bot_draft_attachments",
+ "value": "jsonb_typeof(\"chat_bot_drafts\".\"file_ids\")='array' AND jsonb_array_length(\"chat_bot_drafts\".\"file_ids\")<=5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_schedule_suspensions": {
+ "name": "chat_bot_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_schedule_suspensions_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_schedule_suspensions",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_bot_generation_safe": {
+ "name": "chat_bot_generation_safe",
+ "value": "\"chat_bot_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_sections": {
+ "name": "chat_bot_sections",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "sort_override": {
+ "name": "sort_override",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_bot_sections_viewer": {
+ "name": "chat_bot_sections_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bot_sections_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bot_sections_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bot_sections",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_sections_user_id_users_id_fk": {
+ "name": "chat_bot_sections_user_id_users_id_fk",
+ "tableFrom": "chat_bot_sections",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_bot_viewer_state": {
+ "name": "chat_bot_viewer_state",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pinned": {
+ "name": "pinned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "section_id": {
+ "name": "section_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "position": {
+ "name": "position",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "tags": {
+ "name": "tags",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_bot_viewer_state_bot_id_chat_bots_id_fk": {
+ "name": "chat_bot_viewer_state_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_bot_viewer_state",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bot_viewer_state_user_id_users_id_fk": {
+ "name": "chat_bot_viewer_state_user_id_users_id_fk",
+ "tableFrom": "chat_bot_viewer_state",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_bot_viewer_state_section_id_chat_bot_sections_id_fk": {
+ "name": "chat_bot_viewer_state_section_id_chat_bot_sections_id_fk",
+ "tableFrom": "chat_bot_viewer_state",
+ "tableTo": "chat_bot_sections",
+ "columnsFrom": ["section_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_bot_viewer_state_bot_id_user_id_pk": {
+ "name": "chat_bot_viewer_state_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_bots": {
+ "name": "chat_bots",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "avatar": {
+ "name": "avatar",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deletion_batch": {
+ "name": "deletion_batch",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_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()"
+ }
+ },
+ "indexes": {
+ "chat_bots_workspace_idx": {
+ "name": "chat_bots_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_bots_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_bots_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk": {
+ "name": "chat_bots_workspace_id_parent_id_chat_bots_workspace_id_id_fk",
+ "tableFrom": "chat_bots",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "parent_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_bots_workspace_id_unique": {
+ "name": "chat_bots_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_personal_assistant_active_check": {
+ "name": "chat_personal_assistant_active_check",
+ "value": "\"chat_bots\".\"id\" NOT LIKE 'assistant:%' OR (\"chat_bots\".\"archived_at\" IS NULL AND \"chat_bots\".\"deleted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_composer_drafts": {
+ "name": "chat_composer_drafts",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_composer_drafts_user_id_users_id_fk": {
+ "name": "chat_composer_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_composer_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_composer_drafts_user_id_scope_pk": {
+ "name": "chat_composer_drafts_user_id_scope_pk",
+ "columns": ["user_id", "scope"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_draft_revision_safe": {
+ "name": "chat_draft_revision_safe",
+ "value": "\"chat_composer_drafts\".\"revision\">0 AND \"chat_composer_drafts\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_connected_devices": {
+ "name": "chat_connected_devices",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grants": {
+ "name": "grants",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'"
+ },
+ "last_seen": {
+ "name": "last_seen",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_devices_owner": {
+ "name": "chat_devices_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_connected_devices_user_id_users_id_fk": {
+ "name": "chat_connected_devices_user_id_users_id_fk",
+ "tableFrom": "chat_connected_devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_connected_devices_token_hash_unique": {
+ "name": "chat_connected_devices_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_activity": {
+ "name": "chat_conversation_activity",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "activity_at": {
+ "name": "activity_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_version": {
+ "name": "event_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "read_version": {
+ "name": "read_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "preview": {
+ "name": "preview",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "message_count": {
+ "name": "message_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queued_count": {
+ "name": "queued_count",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "queue_paused": {
+ "name": "queue_paused",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_activity_user_time": {
+ "name": "chat_activity_user_time",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "activity_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_activity_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_conversation_activity_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversation_activity_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_activity_user_id_users_id_fk": {
+ "name": "chat_conversation_activity_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_activity_status": {
+ "name": "chat_activity_status",
+ "value": "\"chat_conversation_activity\".\"status\" IN ('idle','running','approval','setup','error','completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_copies": {
+ "name": "chat_conversation_copies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "retry_id": {
+ "name": "retry_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_bot_id": {
+ "name": "target_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "boundary_json": {
+ "name": "boundary_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'copying'"
+ },
+ "phase": {
+ "name": "phase",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'export'"
+ },
+ "manifest_json": {
+ "name": "manifest_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_page": {
+ "name": "next_page",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "work_version": {
+ "name": "work_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_at": {
+ "name": "retry_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_copies_pending": {
+ "name": "chat_copies_pending",
+ "columns": [
+ {
+ "expression": "source_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "phase",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_copies_viewer": {
+ "name": "chat_copies_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk": {
+ "name": "chat_conversation_copies_retry_id_chat_conversation_retries_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_conversation_retries",
+ "columnsFrom": ["retry_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_copies_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_copies_user_id_users_id_fk": {
+ "name": "chat_conversation_copies_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_copies",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_copies_retry_id_unique": {
+ "name": "chat_conversation_copies_retry_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["retry_id"]
+ },
+ "chat_conversation_copies_target_bot_id_unique": {
+ "name": "chat_conversation_copies_target_bot_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_bot_id"]
+ },
+ "chat_conversation_copies_target_conversation_id_unique": {
+ "name": "chat_conversation_copies_target_conversation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["target_conversation_id"]
+ },
+ "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_copies_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_copy_kind": {
+ "name": "chat_copy_kind",
+ "value": "\"chat_conversation_copies\".\"kind\" IN ('duplicate','fork')"
+ },
+ "chat_copy_status": {
+ "name": "chat_copy_status",
+ "value": "\"chat_conversation_copies\".\"status\" IN ('copying','ready','failed')"
+ },
+ "chat_copy_phase": {
+ "name": "chat_copy_phase",
+ "value": "\"chat_conversation_copies\".\"phase\" IN ('export','transfer','import','publish','cleanup','done')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_mains": {
+ "name": "chat_conversation_mains",
+ "schema": "",
+ "columns": {
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk": {
+ "name": "chat_conversation_mains_conversation_id_bot_id_user_id_chat_conversations_id_bot_id_user_id_fk",
+ "tableFrom": "chat_conversation_mains",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_conversation_mains_bot_id_user_id_pk": {
+ "name": "chat_conversation_mains_bot_id_user_id_pk",
+ "columns": ["bot_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_retries": {
+ "name": "chat_conversation_retries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_bot_id": {
+ "name": "source_bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_json": {
+ "name": "source_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_plan_json": {
+ "name": "file_plan_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'preparing'"
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_retries_viewer": {
+ "name": "chat_retries_viewer",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_conversation_retries_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_conversation_retries_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_conversation_retries_user_id_users_id_fk": {
+ "name": "chat_conversation_retries_user_id_users_id_fk",
+ "tableFrom": "chat_conversation_retries",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique": {
+ "name": "chat_conversation_retries_workspace_id_user_id_idempotency_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_retry_status": {
+ "name": "chat_retry_status",
+ "value": "\"chat_conversation_retries\".\"status\" IN ('preparing','ready','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversation_threads": {
+ "name": "chat_conversation_threads",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_thread_parent_idx": {
+ "name": "chat_thread_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_thread_child_identity_fk": {
+ "name": "chat_thread_child_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_parent_identity_fk": {
+ "name": "chat_thread_parent_identity_fk",
+ "tableFrom": "chat_conversation_threads",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["parent_conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_not_self": {
+ "name": "chat_thread_not_self",
+ "value": "\"chat_conversation_threads\".\"conversation_id\" <> \"chat_conversation_threads\".\"parent_conversation_id\""
+ },
+ "chat_thread_version_nonnegative": {
+ "name": "chat_thread_version_nonnegative",
+ "value": "\"chat_conversation_threads\".\"version\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_conversations": {
+ "name": "chat_conversations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_conversations_bot_id_chat_bots_id_fk": {
+ "name": "chat_conversations_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_conversations_user_id_users_id_fk": {
+ "name": "chat_conversations_user_id_users_id_fk",
+ "tableFrom": "chat_conversations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_conversation_identity": {
+ "name": "chat_conversation_identity",
+ "nullsNotDistinct": false,
+ "columns": ["id", "bot_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_credentials": {
+ "name": "chat_credentials",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_credentials_user_id_users_id_fk": {
+ "name": "chat_credentials_user_id_users_id_fk",
+ "tableFrom": "chat_credentials",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_daily_usage": {
+ "name": "chat_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "chat_daily_usage_user_id_day_pk": {
+ "name": "chat_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_device_operations": {
+ "name": "chat_device_operations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request": {
+ "name": "request",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "result": {
+ "name": "result",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_device_operations_pending": {
+ "name": "chat_device_operations_pending",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_device_operations_device_id_chat_connected_devices_id_fk": {
+ "name": "chat_device_operations_device_id_chat_connected_devices_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_connected_devices",
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_user_id_users_id_fk": {
+ "name": "chat_device_operations_user_id_users_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_device_operations_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_device_operations_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_device_operations",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_execution_membership_generations": {
+ "name": "chat_execution_membership_generations",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_execution_membership_generations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_execution_membership_generations_user_id_users_id_fk": {
+ "name": "chat_execution_membership_generations_user_id_users_id_fk",
+ "tableFrom": "chat_execution_membership_generations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_execution_membership_generations_workspace_id_user_id_pk": {
+ "name": "chat_execution_membership_generations_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_membership_generation_safe": {
+ "name": "chat_membership_generation_safe",
+ "value": "\"chat_execution_membership_generations\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_file_drafts": {
+ "name": "chat_file_drafts",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_file_drafts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_file_drafts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_file_drafts_user_id_users_id_fk": {
+ "name": "chat_file_drafts_user_id_users_id_fk",
+ "tableFrom": "chat_file_drafts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_file_drafts_workspace_id_user_id_id_pk": {
+ "name": "chat_file_drafts_workspace_id_user_id_id_pk",
+ "columns": ["workspace_id", "user_id", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_funded_spend": {
+ "name": "chat_funded_spend",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reserved_micros": {
+ "name": "reserved_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "billed_micros": {
+ "name": "billed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "observed_micros": {
+ "name": "observed_micros",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unknown": {
+ "name": "unknown",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "chat_funded_spend_day_user": {
+ "name": "chat_funded_spend_day_user",
+ "columns": [
+ {
+ "expression": "day",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_funded_spend_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_funded_spend_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_funded_spend_user_id_users_id_fk": {
+ "name": "chat_funded_spend_user_id_users_id_fk",
+ "tableFrom": "chat_funded_spend",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_funded_spend_conversation_id_run_id_pk": {
+ "name": "chat_funded_spend_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_probe": {
+ "name": "chat_kody_account_probe",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_fingerprint": {
+ "name": "source_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_probe_user_id_users_id_fk": {
+ "name": "chat_kody_account_probe_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_probe",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_account_reference_catalog": {
+ "name": "chat_kody_account_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_account_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_account_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_account_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_links": {
+ "name": "chat_kody_links",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_links_user_id_users_id_fk": {
+ "name": "chat_kody_links_user_id_users_id_fk",
+ "tableFrom": "chat_kody_links",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_kody_links_subject_unique": {
+ "name": "chat_kody_links_subject_unique",
+ "nullsNotDistinct": false,
+ "columns": ["subject"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_reference_catalog": {
+ "name": "chat_kody_reference_catalog",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "complete": {
+ "name": "complete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "data_revision": {
+ "name": "data_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_kody_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_kody_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_reference_items": {
+ "name": "chat_kody_reference_items",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ordinal": {
+ "name": "ordinal",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_reference_items_user_id_users_id_fk": {
+ "name": "chat_kody_reference_items_user_id_users_id_fk",
+ "tableFrom": "chat_kody_reference_items",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_reference_items_user_id_revision_ordinal_pk": {
+ "name": "chat_kody_reference_items_user_id_revision_ordinal_pk",
+ "columns": ["user_id", "revision", "ordinal"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_refresh_claims": {
+ "name": "chat_kody_refresh_claims",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "token_fingerprint": {
+ "name": "token_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "claim_id": {
+ "name": "claim_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_refresh_claims_user_id_users_id_fk": {
+ "name": "chat_kody_refresh_claims_user_id_users_id_fk",
+ "tableFrom": "chat_kody_refresh_claims",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_kody_refresh_status": {
+ "name": "chat_kody_refresh_status",
+ "value": "\"chat_kody_refresh_claims\".\"status\" IN ('refreshing','completed','needs_auth')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync": {
+ "name": "chat_kody_skill_sync",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_fingerprint": {
+ "name": "account_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "lease_until": {
+ "name": "lease_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_sync_stage": {
+ "name": "chat_kody_skill_sync_stage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_kody_skill_sync_stage_user_id_users_id_fk": {
+ "name": "chat_kody_skill_sync_stage_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_sync_stage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_sync_stage_user_id_revision_id_pk": {
+ "name": "chat_kody_skill_sync_stage_user_id_revision_id_pk",
+ "columns": ["user_id", "revision", "id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_kody_skill_versions": {
+ "name": "chat_kody_skill_versions",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_id": {
+ "name": "package_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_skill_id": {
+ "name": "source_skill_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "files": {
+ "name": "files",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current": {
+ "name": "current",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_kody_skill_current_idx": {
+ "name": "chat_kody_skill_current_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "current",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_kody_skill_versions_user_id_users_id_fk": {
+ "name": "chat_kody_skill_versions_user_id_users_id_fk",
+ "tableFrom": "chat_kody_skill_versions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_kody_skill_versions_user_id_id_version_pk": {
+ "name": "chat_kody_skill_versions_user_id_id_version_pk",
+ "columns": ["user_id", "id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_account_commands": {
+ "name": "chat_mcp_account_commands",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_account_commands_user_id_users_id_fk": {
+ "name": "chat_mcp_account_commands_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_account_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_account_commands_user_id_command_id_pk": {
+ "name": "chat_mcp_account_commands_user_id_command_id_pk",
+ "columns": ["user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_accounts": {
+ "name": "chat_mcp_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_mode": {
+ "name": "auth_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_revision": {
+ "name": "token_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_at": {
+ "name": "checked_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_claim": {
+ "name": "refresh_claim",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_until": {
+ "name": "refresh_until",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_owner": {
+ "name": "chat_mcp_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_accounts_user_id_users_id_fk": {
+ "name": "chat_mcp_accounts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_auth_mode": {
+ "name": "chat_mcp_auth_mode",
+ "value": "\"chat_mcp_accounts\".\"auth_mode\" IN ('none','token','oauth')"
+ },
+ "chat_mcp_status": {
+ "name": "chat_mcp_status",
+ "value": "\"chat_mcp_accounts\".\"status\" IN ('configured','checked','needs_auth','error')"
+ },
+ "chat_mcp_revision": {
+ "name": "chat_mcp_revision",
+ "value": "\"chat_mcp_accounts\".\"revision\">0"
+ },
+ "chat_mcp_token_revision": {
+ "name": "chat_mcp_token_revision",
+ "value": "\"chat_mcp_accounts\".\"token_revision\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_reference_catalog": {
+ "name": "chat_mcp_reference_catalog",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fingerprint": {
+ "name": "fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fetched_at": {
+ "name": "fetched_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_started_at": {
+ "name": "refresh_started_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_reference_catalog_user_id_users_id_fk": {
+ "name": "chat_mcp_reference_catalog_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_reference_catalog",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk": {
+ "name": "chat_mcp_reference_catalog_workspace_id_user_id_server_id_pk",
+ "columns": ["workspace_id", "user_id", "server_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_mcp_setup_attempts": {
+ "name": "chat_mcp_setup_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "summary": {
+ "name": "summary",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ciphertext": {
+ "name": "ciphertext",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state_hash": {
+ "name": "state_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_hash": {
+ "name": "browser_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_mcp_setup_owner": {
+ "name": "chat_mcp_setup_owner",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_mcp_setup_attempts_user_id_users_id_fk": {
+ "name": "chat_mcp_setup_attempts_user_id_users_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_mcp_setup_attempts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_mcp_setup_attempts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_mcp_setup_attempts_state_hash_unique": {
+ "name": "chat_mcp_setup_attempts_state_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["state_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_mcp_setup_status": {
+ "name": "chat_mcp_setup_status",
+ "value": "\"chat_mcp_setup_attempts\".\"status\" IN ('review','starting','authorize','complete','failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memberships": {
+ "name": "chat_memberships",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memberships_user_idx": {
+ "name": "chat_memberships_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memberships_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memberships_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memberships_user_id_users_id_fk": {
+ "name": "chat_memberships_user_id_users_id_fk",
+ "tableFrom": "chat_memberships",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memberships_workspace_id_user_id_pk": {
+ "name": "chat_memberships_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_memberships_role_check": {
+ "name": "chat_memberships_role_check",
+ "value": "\"chat_memberships\".\"role\" IN ('owner', 'admin', 'member')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_memories": {
+ "name": "chat_memories",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "chat_memory_scope_idx": {
+ "name": "chat_memory_scope_idx",
+ "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": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memories_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memories_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_memories_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_memories_user_id_users_id_fk": {
+ "name": "chat_memories_user_id_users_id_fk",
+ "tableFrom": "chat_memories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_commands": {
+ "name": "chat_memory_commands",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "memory_id": {
+ "name": "memory_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_memory_command_identity_idx": {
+ "name": "chat_memory_command_identity_idx",
+ "columns": [
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "memory_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_memory_commands_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_commands_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_commands",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_memory_commands_conversation_id_command_id_pk": {
+ "name": "chat_memory_commands_conversation_id_command_id_pk",
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_memory_preferences": {
+ "name": "chat_memory_preferences",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_memory_preferences_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_memory_preferences_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_memory_preferences",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_bindings": {
+ "name": "chat_plugin_bindings",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requirement_key": {
+ "name": "requirement_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "server_id": {
+ "name": "server_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint": {
+ "name": "endpoint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_bindings_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_bindings",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_bindings_installation_id_version_requirement_key_pk": {
+ "name": "chat_plugin_bindings_installation_id_version_requirement_key_pk",
+ "columns": ["installation_id", "version", "requirement_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_commands": {
+ "name": "chat_plugin_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_commands_user_id_users_id_fk": {
+ "name": "chat_plugin_commands_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_plugin_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_files": {
+ "name": "chat_plugin_files",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk": {
+ "name": "chat_plugin_files_installation_id_version_chat_plugin_versions_installation_id_version_fk",
+ "tableFrom": "chat_plugin_files",
+ "tableTo": "chat_plugin_versions",
+ "columnsFrom": ["installation_id", "version"],
+ "columnsTo": ["installation_id", "version"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_files_installation_id_version_path_pk": {
+ "name": "chat_plugin_files_installation_id_version_path_pk",
+ "columns": ["installation_id", "version", "path"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_installations": {
+ "name": "chat_plugin_installations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_version": {
+ "name": "current_version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "removed": {
+ "name": "removed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_plugin_owner_list": {
+ "name": "chat_plugin_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "removed",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_plugin_installations_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_plugin_installations_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_plugin_installations_user_id_users_id_fk": {
+ "name": "chat_plugin_installations_user_id_users_id_fk",
+ "tableFrom": "chat_plugin_installations",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_version_positive": {
+ "name": "chat_plugin_version_positive",
+ "value": "\"chat_plugin_installations\".\"current_version\">0"
+ },
+ "chat_plugin_revision_positive": {
+ "name": "chat_plugin_revision_positive",
+ "value": "\"chat_plugin_installations\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_identities": {
+ "name": "chat_plugin_skill_identities",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_skill_identities_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_skill_identities",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_plugin_skill_path": {
+ "name": "chat_plugin_skill_path",
+ "nullsNotDistinct": false,
+ "columns": ["installation_id", "path"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_skill_versions": {
+ "name": "chat_plugin_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk": {
+ "name": "chat_plugin_skill_versions_skill_id_chat_plugin_skill_identities_id_fk",
+ "tableFrom": "chat_plugin_skill_versions",
+ "tableTo": "chat_plugin_skill_identities",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_skill_versions_skill_id_version_pk": {
+ "name": "chat_plugin_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_plugin_versions": {
+ "name": "chat_plugin_versions",
+ "schema": "",
+ "columns": {
+ "installation_id": {
+ "name": "installation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "digest": {
+ "name": "digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview": {
+ "name": "preview",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk": {
+ "name": "chat_plugin_versions_installation_id_chat_plugin_installations_id_fk",
+ "tableFrom": "chat_plugin_versions",
+ "tableTo": "chat_plugin_installations",
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_plugin_versions_installation_id_version_pk": {
+ "name": "chat_plugin_versions_installation_id_version_pk",
+ "columns": ["installation_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_plugin_saved_version_positive": {
+ "name": "chat_plugin_saved_version_positive",
+ "value": "\"chat_plugin_versions\".\"version\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_recipes": {
+ "name": "chat_recipes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code": {
+ "name": "code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_recipes_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_recipes_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_recipes",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_run_usage_receipts": {
+ "name": "chat_run_usage_receipts",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scheduled": {
+ "name": "scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_id": {
+ "name": "attempt_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_run_usage_receipts_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_run_usage_receipts_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_user_id_users_id_fk": {
+ "name": "chat_run_usage_receipts_user_id_users_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_run_usage_receipts_bot_id_chat_bots_id_fk": {
+ "name": "chat_run_usage_receipts_bot_id_chat_bots_id_fk",
+ "tableFrom": "chat_run_usage_receipts",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["bot_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_run_usage_receipts_conversation_id_run_id_pk": {
+ "name": "chat_run_usage_receipts_conversation_id_run_id_pk",
+ "columns": ["conversation_id", "run_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_run_usage_receipts_attempt_id_unique": {
+ "name": "chat_run_usage_receipts_attempt_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attempt_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_file_imports": {
+ "name": "chat_saved_file_imports",
+ "schema": "",
+ "columns": {
+ "target_file_id": {
+ "name": "target_file_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_conversation_id": {
+ "name": "target_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_conversation_id": {
+ "name": "source_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_import_target_idx": {
+ "name": "chat_file_import_target_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_file_imports_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_user_id_users_id_fk": {
+ "name": "chat_saved_file_imports_user_id_users_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_saved_file_imports_target_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_saved_file_imports",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["target_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_import_size": {
+ "name": "chat_file_import_size",
+ "value": "\"chat_saved_file_imports\".\"size\">=0 AND \"chat_saved_file_imports\".\"size\"<=2097152"
+ },
+ "chat_file_import_digest": {
+ "name": "chat_file_import_digest",
+ "value": "\"chat_saved_file_imports\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_import_source": {
+ "name": "chat_file_import_source",
+ "value": "\"chat_saved_file_imports\".\"source\" IN ('upload','assistant')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_saved_files": {
+ "name": "chat_saved_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bot_id": {
+ "name": "bot_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_id": {
+ "name": "draft_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "media_type": {
+ "name": "media_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sha256": {
+ "name": "sha256",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_file_conversation_idx": {
+ "name": "chat_file_conversation_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "conversation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_file_draft_idx": {
+ "name": "chat_file_draft_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "draft_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_saved_files_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_saved_files_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_saved_files_user_id_users_id_fk": {
+ "name": "chat_saved_files_user_id_users_id_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_draft_fk": {
+ "name": "chat_file_draft_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_file_drafts",
+ "columnsFrom": ["workspace_id", "user_id", "draft_id"],
+ "columnsTo": ["workspace_id", "user_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_conversation_fk": {
+ "name": "chat_file_conversation_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id", "bot_id", "user_id"],
+ "columnsTo": ["id", "bot_id", "user_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_file_workspace_fk": {
+ "name": "chat_file_workspace_fk",
+ "tableFrom": "chat_saved_files",
+ "tableTo": "chat_bots",
+ "columnsFrom": ["workspace_id", "bot_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_file_scope": {
+ "name": "chat_file_scope",
+ "value": "(\"chat_saved_files\".\"draft_id\" IS NOT NULL AND \"chat_saved_files\".\"bot_id\" IS NULL AND \"chat_saved_files\".\"conversation_id\" IS NULL) OR (\"chat_saved_files\".\"draft_id\" IS NULL AND \"chat_saved_files\".\"bot_id\" IS NOT NULL AND \"chat_saved_files\".\"conversation_id\" IS NOT NULL)"
+ },
+ "chat_file_size": {
+ "name": "chat_file_size",
+ "value": "\"chat_saved_files\".\"size\">=0 AND \"chat_saved_files\".\"size\"<=2097152"
+ },
+ "chat_file_name": {
+ "name": "chat_file_name",
+ "value": "length(\"chat_saved_files\".\"name\") BETWEEN 1 AND 180"
+ },
+ "chat_file_digest": {
+ "name": "chat_file_digest",
+ "value": "\"chat_saved_files\".\"sha256\" ~ '^[0-9a-f]{64}$'"
+ },
+ "chat_file_source": {
+ "name": "chat_file_source",
+ "value": "\"chat_saved_files\".\"source\" IN ('upload','assistant')"
+ },
+ "chat_file_state": {
+ "name": "chat_file_state",
+ "value": "\"chat_saved_files\".\"state\" IN ('pending','ready')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_scheduled_daily_usage": {
+ "name": "chat_scheduled_daily_usage",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "day": {
+ "name": "day",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "turns": {
+ "name": "turns",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_scheduled_daily_usage_user_id_users_id_fk": {
+ "name": "chat_scheduled_daily_usage_user_id_users_id_fk",
+ "tableFrom": "chat_scheduled_daily_usage",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_scheduled_daily_usage_user_id_day_pk": {
+ "name": "chat_scheduled_daily_usage_user_id_day_pk",
+ "columns": ["user_id", "day"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_scheduled_turns_nonnegative": {
+ "name": "chat_scheduled_turns_nonnegative",
+ "value": "\"chat_scheduled_daily_usage\".\"turns\">=0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_commands": {
+ "name": "chat_skill_commands",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "receipt": {
+ "name": "receipt",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_commands_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skill_commands_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skill_commands_user_id_users_id_fk": {
+ "name": "chat_skill_commands_user_id_users_id_fk",
+ "tableFrom": "chat_skill_commands",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_commands_workspace_id_user_id_command_id_pk": {
+ "name": "chat_skill_commands_workspace_id_user_id_command_id_pk",
+ "columns": ["workspace_id", "user_id", "command_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_skill_versions": {
+ "name": "chat_skill_versions",
+ "schema": "",
+ "columns": {
+ "skill_id": {
+ "name": "skill_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document": {
+ "name": "document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_skill_versions_skill_id_chat_skills_id_fk": {
+ "name": "chat_skill_versions_skill_id_chat_skills_id_fk",
+ "tableFrom": "chat_skill_versions",
+ "tableTo": "chat_skills",
+ "columnsFrom": ["skill_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_skill_versions_skill_id_version_pk": {
+ "name": "chat_skill_versions_skill_id_version_pk",
+ "columns": ["skill_id", "version"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_saved_version": {
+ "name": "chat_skill_saved_version",
+ "value": "\"chat_skill_versions\".\"version\">0 AND \"chat_skill_versions\".\"version\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_skills": {
+ "name": "chat_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "chat_skill_owner_list": {
+ "name": "chat_skill_owner_list",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archived",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_skills_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_skills_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_skills_user_id_users_id_fk": {
+ "name": "chat_skills_user_id_users_id_fk",
+ "tableFrom": "chat_skills",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_skill_version": {
+ "name": "chat_skill_version",
+ "value": "\"chat_skills\".\"version\">0 AND \"chat_skills\".\"version\"<=9007199254740991"
+ },
+ "chat_skill_revision": {
+ "name": "chat_skill_revision",
+ "value": "\"chat_skills\".\"revision\">0 AND \"chat_skills\".\"revision\"<=9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_requests": {
+ "name": "chat_thread_requests",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_digest": {
+ "name": "request_digest",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_conversation_id": {
+ "name": "parent_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_message_id": {
+ "name": "source_message_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_requests_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_thread_requests_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_user_id_users_id_fk": {
+ "name": "chat_thread_requests_user_id_users_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_thread_requests_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_thread_requests_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_thread_requests",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_thread_requests_workspace_id_user_id_idempotency_key_pk": {
+ "name": "chat_thread_requests_workspace_id_user_id_idempotency_key_pk",
+ "columns": ["workspace_id", "user_id", "idempotency_key"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_thread_schedule_suspensions": {
+ "name": "chat_thread_schedule_suspensions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk": {
+ "name": "chat_thread_schedule_suspensions_conversation_id_chat_conversation_threads_conversation_id_fk",
+ "tableFrom": "chat_thread_schedule_suspensions",
+ "tableTo": "chat_conversation_threads",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["conversation_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "chat_thread_generation_safe": {
+ "name": "chat_thread_generation_safe",
+ "value": "\"chat_thread_schedule_suspensions\".\"generation\" BETWEEN 0 AND 9007199254740991"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_children": {
+ "name": "chat_workflow_children",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_conversation_id": {
+ "name": "owner_conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_run_id": {
+ "name": "workflow_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "step_id": {
+ "name": "step_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admission_json": {
+ "name": "admission_json",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_children_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_children_owner_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_children",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["owner_conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique": {
+ "name": "chat_workflow_children_owner_conversation_id_workflow_run_id_step_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["owner_conversation_id", "workflow_run_id", "step_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_child_admission_json": {
+ "name": "chat_workflow_child_admission_json",
+ "value": "jsonb_typeof(\"chat_workflow_children\".\"admission_json\"::jsonb)='object'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workflow_revisions": {
+ "name": "chat_workflow_revisions",
+ "schema": "",
+ "columns": {
+ "conversation_id": {
+ "name": "conversation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workflow_id": {
+ "name": "workflow_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "command_id": {
+ "name": "command_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_hash": {
+ "name": "request_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "definition_json": {
+ "name": "definition_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workflow_revisions_conversation_id_chat_conversations_id_fk": {
+ "name": "chat_workflow_revisions_conversation_id_chat_conversations_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_conversations",
+ "columnsFrom": ["conversation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workflow_revisions_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "chat_workflow_revisions_user_id_users_id_fk": {
+ "name": "chat_workflow_revisions_user_id_users_id_fk",
+ "tableFrom": "chat_workflow_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workflow_revisions_conversation_id_workflow_id_revision_pk": {
+ "name": "chat_workflow_revisions_conversation_id_workflow_id_revision_pk",
+ "columns": ["conversation_id", "workflow_id", "revision"]
+ }
+ },
+ "uniqueConstraints": {
+ "chat_workflow_revisions_conversation_id_command_id_unique": {
+ "name": "chat_workflow_revisions_conversation_id_command_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["conversation_id", "command_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "chat_workflow_revision_positive": {
+ "name": "chat_workflow_revision_positive",
+ "value": "\"chat_workflow_revisions\".\"revision\">0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.chat_workspace_sync_clock": {
+ "name": "chat_workspace_sync_clock",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "published_revision": {
+ "name": "published_revision",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workspace_sync_clock_workspace_id_chat_workspaces_id_fk": {
+ "name": "chat_workspace_sync_clock_workspace_id_chat_workspaces_id_fk",
+ "tableFrom": "chat_workspace_sync_clock",
+ "tableTo": "chat_workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspace_sync_members": {
+ "name": "chat_workspace_sync_members",
+ "schema": "",
+ "columns": {
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "generation": {
+ "name": "generation",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "chat_workspace_sync_members_workspace_id_user_id_chat_memberships_workspace_id_user_id_fk": {
+ "name": "chat_workspace_sync_members_workspace_id_user_id_chat_memberships_workspace_id_user_id_fk",
+ "tableFrom": "chat_workspace_sync_members",
+ "tableTo": "chat_memberships",
+ "columnsFrom": ["workspace_id", "user_id"],
+ "columnsTo": ["workspace_id", "user_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "chat_workspace_sync_members_workspace_id_user_id_pk": {
+ "name": "chat_workspace_sync_members_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.chat_workspaces": {
+ "name": "chat_workspaces",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "policy": {
+ "name": "policy",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "chat_workspaces_owner_idx": {
+ "name": "chat_workspaces_owner_idx",
+ "columns": [
+ {
+ "expression": "owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "chat_workspaces_owner_id_users_id_fk": {
+ "name": "chat_workspaces_owner_id_users_id_fk",
+ "tableFrom": "chat_workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.doc_feedback": {
+ "name": "doc_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "doc_feedback_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "character_count": {
+ "name": "character_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_id": {
+ "name": "library_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "library_version": {
+ "name": "library_version",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_selector": {
+ "name": "block_selector",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "block_content_hash": {
+ "name": "block_content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "block_markdown": {
+ "name": "block_markdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "doc_feedback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "is_detached": {
+ "name": "is_detached",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_collapsed": {
+ "name": "is_collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "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": {
+ "doc_feedback_user_id_idx": {
+ "name": "doc_feedback_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_status_idx": {
+ "name": "doc_feedback_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_library_idx": {
+ "name": "doc_feedback_library_idx",
+ "columns": [
+ {
+ "expression": "library_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_page_path_idx": {
+ "name": "doc_feedback_page_path_idx",
+ "columns": [
+ {
+ "expression": "page_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_created_at_idx": {
+ "name": "doc_feedback_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_is_detached_idx": {
+ "name": "doc_feedback_is_detached_idx",
+ "columns": [
+ {
+ "expression": "is_detached",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "doc_feedback_moderated_by_idx": {
+ "name": "doc_feedback_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "doc_feedback_user_id_users_id_fk": {
+ "name": "doc_feedback_user_id_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "doc_feedback_moderated_by_users_id_fk": {
+ "name": "doc_feedback_moderated_by_users_id_fk",
+ "tableFrom": "doc_feedback",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.docs_artifact_cache": {
+ "name": "docs_artifact_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "docs_root": {
+ "name": "docs_root",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_type": {
+ "name": "artifact_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "artifact_key": {
+ "name": "artifact_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "docs_artifact_cache_repo_ref_docs_root_idx": {
+ "name": "docs_artifact_cache_repo_ref_docs_root_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_stale_at_idx": {
+ "name": "docs_artifact_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "docs_artifact_cache_unique": {
+ "name": "docs_artifact_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "docs_root",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "artifact_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_content_cache": {
+ "name": "github_content_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "repo": {
+ "name": "repo",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "git_ref": {
+ "name": "git_ref",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_kind": {
+ "name": "content_kind",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_present": {
+ "name": "is_present",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "text_content": {
+ "name": "text_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "json_content": {
+ "name": "json_content",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_at": {
+ "name": "stale_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": {
+ "github_content_cache_repo_ref_idx": {
+ "name": "github_content_cache_repo_ref_idx",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_stale_at_idx": {
+ "name": "github_content_cache_stale_at_idx",
+ "columns": [
+ {
+ "expression": "stale_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_content_cache_unique": {
+ "name": "github_content_cache_unique",
+ "columns": [
+ {
+ "expression": "repo",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "git_ref",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "content_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_stats_cache": {
+ "name": "github_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "cache_key": {
+ "name": "cache_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stats": {
+ "name": "stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_stats": {
+ "name": "previous_stats",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "github_stats_cache_key_idx": {
+ "name": "github_stats_cache_key_idx",
+ "columns": [
+ {
+ "expression": "cache_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "github_stats_cache_expires_at_idx": {
+ "name": "github_stats_cache_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_stats_cache_cache_key_unique": {
+ "name": "github_stats_cache_cache_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["cache_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_package_versions": {
+ "name": "intent_package_versions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_package_versions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "skill_count": {
+ "name": "skill_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tarball_url": {
+ "name": "tarball_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_status": {
+ "name": "sync_status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "intent_package_versions_package_name_idx": {
+ "name": "intent_package_versions_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_sync_status_idx": {
+ "name": "intent_package_versions_sync_status_idx",
+ "columns": [
+ {
+ "expression": "sync_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_package_versions_package_version_unique": {
+ "name": "intent_package_versions_package_version_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_package_versions_package_name_intent_packages_name_fk": {
+ "name": "intent_package_versions_package_name_intent_packages_name_fk",
+ "tableFrom": "intent_package_versions",
+ "tableTo": "intent_packages",
+ "columnsFrom": ["package_name"],
+ "columnsTo": ["name"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_packages": {
+ "name": "intent_packages",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "verified": {
+ "name": "verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_synced_at": {
+ "name": "last_synced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skill_content": {
+ "name": "intent_skill_content",
+ "schema": "",
+ "columns": {
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.intent_skills": {
+ "name": "intent_skills",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "intent_skills_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "package_version_id": {
+ "name": "package_version_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "framework": {
+ "name": "framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requires": {
+ "name": "requires",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skill_path": {
+ "name": "skill_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "line_count": {
+ "name": "line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "intent_skills_package_version_id_idx": {
+ "name": "intent_skills_package_version_id_idx",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_name_idx": {
+ "name": "intent_skills_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_framework_idx": {
+ "name": "intent_skills_framework_idx",
+ "columns": [
+ {
+ "expression": "framework",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_type_idx": {
+ "name": "intent_skills_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "intent_skills_package_version_skill_unique": {
+ "name": "intent_skills_package_version_skill_unique",
+ "columns": [
+ {
+ "expression": "package_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "intent_skills_package_version_id_intent_package_versions_id_fk": {
+ "name": "intent_skills_package_version_id_intent_package_versions_id_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_package_versions",
+ "columnsFrom": ["package_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "intent_skills_content_hash_intent_skill_content_content_hash_fk": {
+ "name": "intent_skills_content_hash_intent_skill_content_content_hash_fk",
+ "tableFrom": "intent_skills",
+ "tableTo": "intent_skill_content",
+ "columnsFrom": ["content_hash"],
+ "columnsTo": ["content_hash"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_history": {
+ "name": "login_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_new_user": {
+ "name": "is_new_user",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "login_history_user_id_idx": {
+ "name": "login_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_created_at_idx": {
+ "name": "login_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_history_provider_idx": {
+ "name": "login_history_provider_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_history_user_id_users_id_fk": {
+ "name": "login_history_user_id_users_id_fk",
+ "tableFrom": "login_history",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_api_keys": {
+ "name": "mcp_api_keys",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key_hash": {
+ "name": "key_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key_prefix": {
+ "name": "key_prefix",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rate_limit_per_minute": {
+ "name": "rate_limit_per_minute",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 200
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_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()"
+ }
+ },
+ "indexes": {
+ "mcp_api_keys_key_hash_idx": {
+ "name": "mcp_api_keys_key_hash_idx",
+ "columns": [
+ {
+ "expression": "key_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_user_id_idx": {
+ "name": "mcp_api_keys_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_api_keys_is_active_idx": {
+ "name": "mcp_api_keys_is_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mcp_api_keys_user_id_users_id_fk": {
+ "name": "mcp_api_keys_user_id_users_id_fk",
+ "tableFrom": "mcp_api_keys",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "mcp_api_keys_key_hash_unique": {
+ "name": "mcp_api_keys_key_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_rate_limits": {
+ "name": "mcp_rate_limits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "identifier_type": {
+ "name": "identifier_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "mcp_rate_limits_identifier_window_unique": {
+ "name": "mcp_rate_limits_identifier_window_unique",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_identifier_idx": {
+ "name": "mcp_rate_limits_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_rate_limits_window_start_idx": {
+ "name": "mcp_rate_limits_window_start_idx",
+ "columns": [
+ {
+ "expression": "window_start",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.npm_download_chunks": {
+ "name": "npm_download_chunks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_from": {
+ "name": "date_from",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date_to": {
+ "name": "date_to",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "bin_size": {
+ "name": "bin_size",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'daily'"
+ },
+ "total_downloads": {
+ "name": "total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "daily_data": {
+ "name": "daily_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_immutable": {
+ "name": "is_immutable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_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": {
+ "npm_download_chunks_package_date_bin_unique": {
+ "name": "npm_download_chunks_package_date_bin_unique",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "bin_size",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_package_name_idx": {
+ "name": "npm_download_chunks_package_name_idx",
+ "columns": [
+ {
+ "expression": "package_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_from_idx": {
+ "name": "npm_download_chunks_date_from_idx",
+ "columns": [
+ {
+ "expression": "date_from",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_date_to_idx": {
+ "name": "npm_download_chunks_date_to_idx",
+ "columns": [
+ {
+ "expression": "date_to",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_expires_at_idx": {
+ "name": "npm_download_chunks_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "npm_download_chunks_is_immutable_idx": {
+ "name": "npm_download_chunks_is_immutable_idx",
+ "columns": [
+ {
+ "expression": "is_immutable",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_access_tokens": {
+ "name": "oauth_mcp_access_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_used_at": {
+ "name": "last_used_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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_access_tokens_hash_idx": {
+ "name": "oauth_mcp_access_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_user_idx": {
+ "name": "oauth_mcp_access_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_access_tokens_expires_idx": {
+ "name": "oauth_mcp_access_tokens_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_access_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_access_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_access_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_access_tokens_token_hash_unique": {
+ "name": "oauth_mcp_access_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_accounts": {
+ "name": "oauth_accounts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "oauth_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_scope": {
+ "name": "token_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "oauth_accounts_user_id_idx": {
+ "name": "oauth_accounts_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_unique": {
+ "name": "oauth_accounts_provider_account_unique",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_accounts_provider_account_idx": {
+ "name": "oauth_accounts_provider_account_idx",
+ "columns": [
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_account_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_accounts_user_id_users_id_fk": {
+ "name": "oauth_accounts_user_id_users_id_fk",
+ "tableFrom": "oauth_accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_authorization_codes": {
+ "name": "oauth_mcp_authorization_codes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'api'"
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_auth_codes_hash_idx": {
+ "name": "oauth_mcp_auth_codes_hash_idx",
+ "columns": [
+ {
+ "expression": "code_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_auth_codes_expires_idx": {
+ "name": "oauth_mcp_auth_codes_expires_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_authorization_codes_user_id_users_id_fk": {
+ "name": "oauth_mcp_authorization_codes_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_authorization_codes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_authorization_codes_code_hash_unique": {
+ "name": "oauth_mcp_authorization_codes_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oauth_mcp_refresh_tokens": {
+ "name": "oauth_mcp_refresh_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_id": {
+ "name": "access_token_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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()"
+ }
+ },
+ "indexes": {
+ "oauth_mcp_refresh_tokens_hash_idx": {
+ "name": "oauth_mcp_refresh_tokens_hash_idx",
+ "columns": [
+ {
+ "expression": "token_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oauth_mcp_refresh_tokens_user_idx": {
+ "name": "oauth_mcp_refresh_tokens_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "oauth_mcp_refresh_tokens_user_id_users_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_user_id_users_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk": {
+ "name": "oauth_mcp_refresh_tokens_access_token_id_oauth_mcp_access_tokens_id_fk",
+ "tableFrom": "oauth_mcp_refresh_tokens",
+ "tableTo": "oauth_mcp_access_tokens",
+ "columnsFrom": ["access_token_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "oauth_mcp_refresh_tokens_token_hash_unique": {
+ "name": "oauth_mcp_refresh_tokens_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.oss_stats_cache": {
+ "name": "oss_stats_cache",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "scope_type": {
+ "name": "scope_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scope_key": {
+ "name": "scope_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_star_count": {
+ "name": "github_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_contributor_count": {
+ "name": "github_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "github_dependent_count": {
+ "name": "github_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_fork_count": {
+ "name": "github_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_repository_count": {
+ "name": "github_repository_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_star_count": {
+ "name": "github_delta_star_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_contributor_count": {
+ "name": "github_delta_contributor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_dependent_count": {
+ "name": "github_delta_dependent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_delta_fork_count": {
+ "name": "github_delta_fork_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "github_updated_at": {
+ "name": "github_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_total_downloads": {
+ "name": "npm_total_downloads",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_rate_per_day": {
+ "name": "npm_rate_per_day",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "npm_package_count": {
+ "name": "npm_package_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "npm_updated_at": {
+ "name": "npm_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "time_delta_ms": {
+ "name": "time_delta_ms",
+ "type": "bigint",
+ "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": {
+ "oss_stats_cache_scope_unique": {
+ "name": "oss_stats_cache_scope_unique",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_type_idx": {
+ "name": "oss_stats_cache_scope_type_idx",
+ "columns": [
+ {
+ "expression": "scope_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "oss_stats_cache_scope_key_idx": {
+ "name": "oss_stats_cache_scope_key_idx",
+ "columns": [
+ {
+ "expression": "scope_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_assignments": {
+ "name": "role_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "role_assignments_user_id_idx": {
+ "name": "role_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_role_id_idx": {
+ "name": "role_assignments_role_id_idx",
+ "columns": [
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "role_assignments_user_role_unique": {
+ "name": "role_assignments_user_role_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "role_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "role_assignments_user_id_users_id_fk": {
+ "name": "role_assignments_user_id_users_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_assignments_role_id_roles_id_fk": {
+ "name": "role_assignments_role_id_roles_id_fk",
+ "tableFrom": "role_assignments",
+ "tableTo": "roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "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": {
+ "roles_name_idx": {
+ "name": "roles_name_idx",
+ "columns": [
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "roles_name_unique": {
+ "name": "roles_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sessions": {
+ "name": "sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "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()"
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "sessions_token_idx": {
+ "name": "sessions_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_user_id_idx": {
+ "name": "sessions_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "sessions_expires_at_idx": {
+ "name": "sessions_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sessions_user_id_users_id_fk": {
+ "name": "sessions_user_id_users_id_fk",
+ "tableFrom": "sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "sessions_token_unique": {
+ "name": "sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcase_votes": {
+ "name": "showcase_votes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "showcase_id": {
+ "name": "showcase_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "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": {
+ "showcase_votes_showcase_id_idx": {
+ "name": "showcase_votes_showcase_id_idx",
+ "columns": [
+ {
+ "expression": "showcase_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcase_votes_user_id_idx": {
+ "name": "showcase_votes_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcase_votes_showcase_id_showcases_id_fk": {
+ "name": "showcase_votes_showcase_id_showcases_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "showcases",
+ "columnsFrom": ["showcase_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcase_votes_user_id_users_id_fk": {
+ "name": "showcase_votes_user_id_users_id_fk",
+ "tableFrom": "showcase_votes",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "showcase_votes_showcase_id_user_id_unique": {
+ "name": "showcase_votes_showcase_id_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["showcase_id", "user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.showcases": {
+ "name": "showcases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_url": {
+ "name": "screenshot_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_url": {
+ "name": "source_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "libraries": {
+ "name": "libraries",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "use_cases": {
+ "name": "use_cases",
+ "type": "showcase_use_case[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "is_featured": {
+ "name": "is_featured",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "status": {
+ "name": "status",
+ "type": "showcase_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "placement": {
+ "name": "placement",
+ "type": "showcase_placement",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "review_reason": {
+ "name": "review_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_by": {
+ "name": "moderated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderated_at": {
+ "name": "moderated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "moderation_note": {
+ "name": "moderation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank": {
+ "name": "tranco_rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tranco_rank_updated_at": {
+ "name": "tranco_rank_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vote_score": {
+ "name": "vote_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "showcases_user_id_idx": {
+ "name": "showcases_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_idx": {
+ "name": "showcases_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_status_placement_idx": {
+ "name": "showcases_status_placement_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "placement",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_is_featured_idx": {
+ "name": "showcases_is_featured_idx",
+ "columns": [
+ {
+ "expression": "is_featured",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_created_at_idx": {
+ "name": "showcases_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_moderated_by_idx": {
+ "name": "showcases_moderated_by_idx",
+ "columns": [
+ {
+ "expression": "moderated_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_tranco_rank_idx": {
+ "name": "showcases_tranco_rank_idx",
+ "columns": [
+ {
+ "expression": "tranco_rank",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "showcases_vote_score_idx": {
+ "name": "showcases_vote_score_idx",
+ "columns": [
+ {
+ "expression": "vote_score",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "showcases_user_id_users_id_fk": {
+ "name": "showcases_user_id_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "showcases_moderated_by_users_id_fk": {
+ "name": "showcases_moderated_by_users_id_fk",
+ "tableFrom": "showcases",
+ "tableTo": "users",
+ "columnsFrom": ["moderated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_activity": {
+ "name": "user_activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "date": {
+ "name": "date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_activity_user_date_unique": {
+ "name": "user_activity_user_date_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_user_id_idx": {
+ "name": "user_activity_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_activity_date_idx": {
+ "name": "user_activity_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_activity_user_id_users_id_fk": {
+ "name": "user_activity_user_id_users_id_fk",
+ "tableFrom": "user_activity",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_username": {
+ "name": "display_username",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "oauth_image": {
+ "name": "oauth_image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "capabilities": {
+ "name": "capabilities",
+ "type": "capability[]",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "ads_disabled": {
+ "name": "ads_disabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "interested_in_hiding_ads": {
+ "name": "interested_in_hiding_ads",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "last_used_framework": {
+ "name": "last_used_framework",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signup_sources": {
+ "name": "signup_sources",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "session_version": {
+ "name": "session_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.audit_action": {
+ "name": "audit_action",
+ "schema": "public",
+ "values": [
+ "user.capabilities.update",
+ "user.adsDisabled.update",
+ "user.sessions.revoke",
+ "role.create",
+ "role.update",
+ "role.delete",
+ "role.assignment.create",
+ "role.assignment.delete",
+ "feedback.moderate",
+ "showcase.create",
+ "showcase.update",
+ "showcase.delete",
+ "showcase.moderate"
+ ]
+ },
+ "public.builder_message_role": {
+ "name": "builder_message_role",
+ "schema": "public",
+ "values": ["user", "assistant"]
+ },
+ "public.builder_project_event_type": {
+ "name": "builder_project_event_type",
+ "schema": "public",
+ "values": [
+ "project.created",
+ "project.updated",
+ "project.deleted",
+ "thread.created",
+ "thread.updated",
+ "thread.archived",
+ "revision.created",
+ "message.created",
+ "message.updated",
+ "message.deleted",
+ "run.created",
+ "run.started",
+ "run.activity",
+ "run.interrupted",
+ "run.completed",
+ "run.failed",
+ "run.cancelled"
+ ]
+ },
+ "public.builder_run_status": {
+ "name": "builder_run_status",
+ "schema": "public",
+ "values": [
+ "pending",
+ "running",
+ "interrupted",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "public.capability": {
+ "name": "capability",
+ "schema": "public",
+ "values": [
+ "admin",
+ "api-keys",
+ "disableAds",
+ "builder",
+ "mcp",
+ "moderate-feedback",
+ "moderate-showcases"
+ ]
+ },
+ "public.doc_feedback_status": {
+ "name": "doc_feedback_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.doc_feedback_type": {
+ "name": "doc_feedback_type",
+ "schema": "public",
+ "values": ["note", "improvement"]
+ },
+ "public.oauth_provider": {
+ "name": "oauth_provider",
+ "schema": "public",
+ "values": ["github", "google"]
+ },
+ "public.showcase_placement": {
+ "name": "showcase_placement",
+ "schema": "public",
+ "values": ["showcase", "community", "private"]
+ },
+ "public.showcase_status": {
+ "name": "showcase_status",
+ "schema": "public",
+ "values": ["pending", "approved", "denied"]
+ },
+ "public.showcase_use_case": {
+ "name": "showcase_use_case",
+ "schema": "public",
+ "values": [
+ "blog",
+ "e-commerce",
+ "saas",
+ "dashboard",
+ "documentation",
+ "portfolio",
+ "social",
+ "developer-tool",
+ "marketing",
+ "media",
+ "open-source"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/drizzle/migrations/meta/_journal.json b/drizzle/migrations/meta/_journal.json
index 16d84a419..0c98b7543 100644
--- a/drizzle/migrations/meta/_journal.json
+++ b/drizzle/migrations/meta/_journal.json
@@ -15,6 +15,272 @@
"when": 1789144581608,
"tag": "0001_showcase_placements",
"breakpoints": true
+ },
+ {
+ "idx": 2,
+ "version": "7",
+ "when": 1790803716870,
+ "tag": "0002_tanchat_account_workspace",
+ "breakpoints": true
+ },
+ {
+ "idx": 3,
+ "version": "7",
+ "when": 1790804343014,
+ "tag": "0003_tanchat_conversation_identity",
+ "breakpoints": true
+ },
+ {
+ "idx": 4,
+ "version": "7",
+ "when": 1790804442943,
+ "tag": "0004_tanchat_thread_context",
+ "breakpoints": true
+ },
+ {
+ "idx": 5,
+ "version": "7",
+ "when": 1790804526518,
+ "tag": "0005_tanchat_thread_requests",
+ "breakpoints": true
+ },
+ {
+ "idx": 6,
+ "version": "7",
+ "when": 1790805357384,
+ "tag": "0006_tanchat_credentials",
+ "breakpoints": true
+ },
+ {
+ "idx": 7,
+ "version": "7",
+ "when": 1790805453948,
+ "tag": "0007_tanchat_account_preferences",
+ "breakpoints": true
+ },
+ {
+ "idx": 8,
+ "version": "7",
+ "when": 1790805586259,
+ "tag": "0008_tanchat_conversation_memory",
+ "breakpoints": true
+ },
+ {
+ "idx": 9,
+ "version": "7",
+ "when": 1790805696593,
+ "tag": "0009_tanchat_composer_drafts",
+ "breakpoints": true
+ },
+ {
+ "idx": 10,
+ "version": "7",
+ "when": 1790806185072,
+ "tag": "0010_tanchat_saved_files",
+ "breakpoints": true
+ },
+ {
+ "idx": 11,
+ "version": "7",
+ "when": 1790807013143,
+ "tag": "0011_tanchat_first_send_receipts",
+ "breakpoints": true
+ },
+ {
+ "idx": 12,
+ "version": "7",
+ "when": 1790807108503,
+ "tag": "0012_tanchat_first_send_identity",
+ "breakpoints": true
+ },
+ {
+ "idx": 13,
+ "version": "7",
+ "when": 1790807475664,
+ "tag": "0013_tanchat_skills",
+ "breakpoints": true
+ },
+ {
+ "idx": 14,
+ "version": "7",
+ "when": 1790807895465,
+ "tag": "0014_pale_risque",
+ "breakpoints": true
+ },
+ {
+ "idx": 15,
+ "version": "7",
+ "when": 1790808078912,
+ "tag": "0015_married_machine_man",
+ "breakpoints": true
+ },
+ {
+ "idx": 16,
+ "version": "7",
+ "when": 1790808144088,
+ "tag": "0016_crazy_cable",
+ "breakpoints": true
+ },
+ {
+ "idx": 17,
+ "version": "7",
+ "when": 1790808408369,
+ "tag": "0017_messy_sabretooth",
+ "breakpoints": true
+ },
+ {
+ "idx": 18,
+ "version": "7",
+ "when": 1790808779507,
+ "tag": "0018_large_rawhide_kid",
+ "breakpoints": true
+ },
+ {
+ "idx": 19,
+ "version": "7",
+ "when": 1790809391944,
+ "tag": "0019_slow_power_pack",
+ "breakpoints": true
+ },
+ {
+ "idx": 20,
+ "version": "7",
+ "when": 1790810344651,
+ "tag": "0020_tranquil_harpoon",
+ "breakpoints": true
+ },
+ {
+ "idx": 21,
+ "version": "7",
+ "when": 1790810546448,
+ "tag": "0021_even_roulette",
+ "breakpoints": true
+ },
+ {
+ "idx": 22,
+ "version": "7",
+ "when": 1790810639274,
+ "tag": "0022_tricky_texas_twister",
+ "breakpoints": true
+ },
+ {
+ "idx": 23,
+ "version": "7",
+ "when": 1790810734403,
+ "tag": "0023_productive_the_spike",
+ "breakpoints": true
+ },
+ {
+ "idx": 24,
+ "version": "7",
+ "when": 1790810869326,
+ "tag": "0024_worried_dazzler",
+ "breakpoints": true
+ },
+ {
+ "idx": 25,
+ "version": "7",
+ "when": 1790811081040,
+ "tag": "0025_crazy_emma_frost",
+ "breakpoints": true
+ },
+ {
+ "idx": 26,
+ "version": "7",
+ "when": 1790811199611,
+ "tag": "0026_youthful_maria_hill",
+ "breakpoints": true
+ },
+ {
+ "idx": 27,
+ "version": "7",
+ "when": 1790811313929,
+ "tag": "0027_certain_captain_stacy",
+ "breakpoints": true
+ },
+ {
+ "idx": 28,
+ "version": "7",
+ "when": 1790811629910,
+ "tag": "0028_nebulous_songbird",
+ "breakpoints": true
+ },
+ {
+ "idx": 29,
+ "version": "7",
+ "when": 1790811834170,
+ "tag": "0029_faithful_loa",
+ "breakpoints": true
+ },
+ {
+ "idx": 30,
+ "version": "7",
+ "when": 1790811945834,
+ "tag": "0030_last_expediter",
+ "breakpoints": true
+ },
+ {
+ "idx": 31,
+ "version": "7",
+ "when": 1790812110806,
+ "tag": "0031_sloppy_mesmero",
+ "breakpoints": true
+ },
+ {
+ "idx": 32,
+ "version": "7",
+ "when": 1790812622926,
+ "tag": "0032_low_jack_murdock",
+ "breakpoints": true
+ },
+ {
+ "idx": 33,
+ "version": "7",
+ "when": 1790812766275,
+ "tag": "0033_breezy_mister_sinister",
+ "breakpoints": true
+ },
+ {
+ "idx": 34,
+ "version": "7",
+ "when": 1790813750231,
+ "tag": "0034_tanchat_parent_guards",
+ "breakpoints": true
+ },
+ {
+ "idx": 35,
+ "version": "7",
+ "when": 1790814638416,
+ "tag": "0035_tanchat_saved_actions",
+ "breakpoints": true
+ },
+ {
+ "idx": 36,
+ "version": "7",
+ "when": 1790816512083,
+ "tag": "0036_tanchat_onboarding",
+ "breakpoints": true
+ },
+ {
+ "idx": 37,
+ "version": "7",
+ "when": 1790822074465,
+ "tag": "0037_tanchat_kody_oauth",
+ "breakpoints": true
+ },
+ {
+ "idx": 38,
+ "version": "7",
+ "when": 1790832197649,
+ "tag": "0038_tanchat_cascade_lifecycle",
+ "breakpoints": true
+ },
+ {
+ "idx": 39,
+ "version": "7",
+ "when": 1790889000000,
+ "tag": "0039_tanchat_invites",
+ "breakpoints": true
}
]
}
diff --git a/harness-tests/core/account-preferences-http.test.ts b/harness-tests/core/account-preferences-http.test.ts
new file mode 100644
index 000000000..22f8beaad
--- /dev/null
+++ b/harness-tests/core/account-preferences-http.test.ts
@@ -0,0 +1,95 @@
+// These HTTP fixtures represent admitted accounts. Access grants are tested in chat-access.test.ts.
+vi.mock('~/chat/access.server', () => ({
+ hasChatAccess: async (user: { capabilities: string[] }) =>
+ user.capabilities.includes('builder') ||
+ user.capabilities.includes('admin'),
+}))
+import { beforeEach, expect, it, vi } from 'vitest'
+const mocks = vi.hoisted(() => ({
+ user: vi.fn(),
+ read: vi.fn(),
+ update: vi.fn(),
+}))
+vi.mock('~/auth/index.server', () => ({
+ getAuthService: () => ({ getCurrentUser: mocks.user }),
+}))
+vi.mock('../../src/chat/server/account-preferences', () => ({
+ readAccountPreferences: mocks.read,
+ updateAccountPreferences: mocks.update,
+ AccountPreferencesError: class extends Error {
+ constructor(
+ message: string,
+ public status: number,
+ ) {
+ super(message)
+ }
+ },
+}))
+import { handleAccountPreferences } from '../../src/chat/server/account-preferences-http.server'
+beforeEach(() => {
+ vi.resetAllMocks()
+ mocks.user.mockResolvedValue({
+ userId: 'signed-in',
+ capabilities: ['builder'],
+ })
+ mocks.read.mockResolvedValue({ revision: 1 })
+ mocks.update.mockResolvedValue({ revision: 2 })
+})
+it('uses the session account instead of a query account', async () => {
+ const response = await handleAccountPreferences(
+ new Request(
+ 'https://tanstack.com/api/chat/account/preferences?userId=someone-else',
+ ),
+ )
+ expect(response.status).toBe(200)
+ expect(mocks.read).toHaveBeenCalledWith('signed-in')
+})
+it('denies signed-out reads before touching preference storage', async () => {
+ mocks.user.mockResolvedValue(null)
+ expect(
+ (
+ await handleAccountPreferences(
+ new Request('https://tanstack.com/api/chat/account/preferences'),
+ )
+ ).status,
+ ).toBe(401)
+ expect(mocks.read).not.toHaveBeenCalled()
+})
+it('denies cross-origin writes before touching the account', async () => {
+ const response = await handleAccountPreferences(
+ new Request('https://tanstack.com/api/chat/account/preferences', {
+ method: 'POST',
+ headers: { Origin: 'https://elsewhere.example' },
+ body: '{}',
+ }),
+ )
+ expect(response.status).toBe(403)
+ expect(mocks.user).not.toHaveBeenCalled()
+ expect(mocks.update).not.toHaveBeenCalled()
+})
+it('passes bounded JSON to the service with the authenticated account', async () => {
+ const body = { timezone: 'America/Denver', revision: 1 }
+ const response = await handleAccountPreferences(
+ new Request('https://tanstack.com/api/chat/account/preferences', {
+ method: 'POST',
+ headers: { Origin: 'https://tanstack.com' },
+ body: JSON.stringify(body),
+ }),
+ )
+ expect(response.status).toBe(200)
+ expect(mocks.update).toHaveBeenCalledWith('signed-in', body)
+})
+
+it('returns preference revision conflicts without masking them', async () => {
+ const { AccountPreferencesError } =
+ await import('../../src/chat/server/account-preferences')
+ mocks.update.mockRejectedValue(new AccountPreferencesError('Changed', 409))
+ const response = await handleAccountPreferences(
+ new Request('https://tanstack.com/api/chat/account/preferences', {
+ method: 'POST',
+ headers: { Origin: 'https://tanstack.com' },
+ body: JSON.stringify({ revision: 1 }),
+ }),
+ )
+ expect(response.status).toBe(409)
+})
diff --git a/harness-tests/core/action-evidence-context.test.ts b/harness-tests/core/action-evidence-context.test.ts
new file mode 100644
index 000000000..ce397c4de
--- /dev/null
+++ b/harness-tests/core/action-evidence-context.test.ts
@@ -0,0 +1,106 @@
+import { expect, it } from 'vitest'
+import { convertMessagesToModelMessages, type ModelMessage } from '@tanstack/ai'
+import { projectAssistantContext } from '../../src/chat/server/assistant-context'
+
+function memory() {
+ const values = new Map()
+ return {
+ values,
+ put: async (id: string, value: unknown) => {
+ values.set(id, value)
+ },
+ get: async (id: string) => values.get(id),
+ }
+}
+const evidence = (content: string): ModelMessage => ({
+ role: 'user',
+ content,
+ metadata: { gumActionEvidence: true },
+})
+
+it('retains the host evidence marker through TanStack AI message conversion', () => {
+ const converted = convertMessagesToModelMessages([
+ {
+ id: 'action-evidence:copy',
+ role: 'user',
+ metadata: { gumActionEvidence: true },
+ parts: [{ type: 'text', content: 'Confirmed earlier write.' }],
+ },
+ ])
+ expect(converted).toHaveLength(1)
+ expect(converted[0].metadata?.gumActionEvidence).toBe(true)
+ expect(converted[0].toolCalls).toBeUndefined()
+})
+
+it('keeps all earlier action evidence when ordinary history is compacted', async () => {
+ const store = memory()
+ const records = [
+ evidence('Write A succeeded.'),
+ evidence('Write B outcome unknown.'),
+ ]
+ const history: ModelMessage[] = Array.from({ length: 25 }, (_, index) => [
+ { role: 'user' as const, content: `Request ${index}` },
+ { role: 'assistant' as const, content: 'Earlier response '.repeat(300) },
+ ]).flat()
+ const latest: ModelMessage = {
+ role: 'user',
+ content: 'Summarize the results.',
+ }
+ const result = await projectAssistantContext(
+ [...records, ...history, latest],
+ store,
+ 18000,
+ )
+ expect(result).toContainEqual(records[0])
+ expect(result).toContainEqual(records[1])
+ expect(result.at(-1)).toEqual(latest)
+ expect(result.length).toBeLessThan(history.length)
+ expect(
+ result.filter((message) => message.metadata?.gumActionEvidence),
+ ).toHaveLength(2)
+ expect([...store.values.values()].flat()).not.toContainEqual(records[0])
+ expect([...store.values.values()].flat()).not.toContainEqual(records[1])
+})
+
+it('retains a read-before-write reference to oversized evidence across repeated passes', async () => {
+ const store = memory()
+ const record = evidence(
+ 'Large original result '.repeat(2000) + 'Write outcome: unknown.',
+ )
+ const first = await projectAssistantContext(
+ [record, { role: 'user', content: 'Check that earlier result.' }],
+ store,
+ )
+ const preserved = first.find(
+ (message) => message.metadata?.gumActionEvidence,
+ )!
+ const reference = JSON.parse(preserved.content as string)
+ expect(reference.notice).toContain('before proposing or repeating a write')
+ expect(reference.notice).toContain('verify unknown outcomes')
+ expect(await store.get(reference.archivedMessage)).toEqual(record)
+ const pressure: ModelMessage[] = Array.from({ length: 20 }, (_, index) => ({
+ role: 'user',
+ content: `Later ${index}: ` + 'text '.repeat(1500),
+ }))
+ const second = await projectAssistantContext(
+ [...first, ...pressure],
+ store,
+ 18000,
+ )
+ expect(second).toContainEqual(preserved)
+ expect(await store.get(reference.archivedMessage)).toEqual(record)
+ expect(second.flatMap((message) => message.toolCalls ?? [])).toEqual([])
+})
+
+it('fails instead of discarding action evidence when the evidence itself exceeds the model budget', async () => {
+ const records = Array.from({ length: 8 }, (_, index) =>
+ evidence(`Write ${index} ` + 'outcome '.repeat(900)),
+ )
+ await expect(
+ projectAssistantContext(
+ [...records, { role: 'user', content: 'Do the next step.' }],
+ memory(),
+ 18000,
+ ),
+ ).rejects.toThrow('context budget')
+})
diff --git a/harness-tests/core/answer-evidence.test.ts b/harness-tests/core/answer-evidence.test.ts
new file mode 100644
index 000000000..310d238c0
--- /dev/null
+++ b/harness-tests/core/answer-evidence.test.ts
@@ -0,0 +1,132 @@
+import { beforeEach, expect, it, vi } from 'vitest'
+const mocks = vi.hoisted(() => ({ decide: vi.fn() }))
+vi.mock('@tanstack/ai', async (original) => ({
+ ...(await original