Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat(skills): track GitHub sources and update installed skills (#23453)

AmAzing-2821ecc53bd0
diff --git a/apps/server/src/modules/GitHub/index.test.ts b/apps/server/src/modules/GitHub/index.test.ts
index ff6822cbb6e..d2077cf5493 100644
--- a/apps/server/src/modules/GitHub/index.test.ts
+++ b/apps/server/src/modules/GitHub/index.test.ts
@@ -1,4 +1,5 @@
// @vitest-environment node
+import { strToU8, zipSync } from 'fflate';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import {
@@ -7,6 +8,7 @@ import {
GitHubDownloadError,
GitHubNotFoundError,
GitHubParseError,
+ GitHubRateLimitError,
} from './index';
describe('GitHub', () => {
@@ -390,6 +392,81 @@ describe('GitHub', () => {
});
});
+ describe('resolveCommit', () => {
+ const gh = new GitHub();
+ const info = { branch: 'main', owner: 'lobehub', repo: 'lobe-chat' };
+
+ afterEach(() => {
+ vi.unstubAllGlobals();
+ });
+
+ it.each([404, 422])(
+ 'reports a missing repository or ref (HTTP %d) as not found',
+ async (status) => {
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue(new Response('', { status })));
+
+ await expect(gh.resolveCommit(info)).rejects.toBeInstanceOf(GitHubNotFoundError);
+ },
+ );
+
+ it('reports an exhausted quota as a rate limit', async () => {
+ vi.stubGlobal(
+ 'fetch',
+ vi
+ .fn()
+ .mockResolvedValue(
+ new Response('', { headers: { 'x-ratelimit-remaining': '0' }, status: 403 }),
+ ),
+ );
+
+ await expect(gh.resolveCommit(info)).rejects.toBeInstanceOf(GitHubRateLimitError);
+ });
+ });
+
+ describe('downloadRefZip', () => {
+ const gh = new GitHub();
+ const info = { branch: 'main', owner: 'lobehub', repo: 'lobe-chat' };
+ const commit = 'a'.repeat(40);
+ const files = { 'lobe-chat-main/SKILL.md': strToU8('# Skill') };
+ // GitHub writes the commit into the archive comment, which closes the file.
+ const withComment = (zip: Uint8Array, comment: string) => {
+ const archive = Buffer.concat([zip, Buffer.from(comment, 'latin1')]);
+ archive.writeUInt16LE(comment.length, zip.length - 2);
+ return archive;
+ };
+
+ afterEach(() => {
+ vi.unstubAllGlobals();
+ });
+
+ it('reads the commit from the archive comment without the REST API', async () => {
+ const zip = withComment(zipSync(files), commit);
+ const mockFetch = vi.fn().mockResolvedValue(new Response(zip));
+ vi.stubGlobal('fetch', mockFetch);
+
+ const result = await gh.downloadRefZip(info);
+
+ expect(result.commit).toBe(commit);
+ expect(result.buffer.equals(zip)).toBe(true);
+ expect(mockFetch).toHaveBeenCalledTimes(1);
+ expect(mockFetch.mock.calls[0][0]).toBe(
+ 'https://github.com/lobehub/lobe-chat/archive/refs/heads/main.zip',
+ );
+ });
+
+ it('rejects an archive that does not name its commit', async () => {
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue(new Response(zipSync(files))));
+
+ await expect(gh.downloadRefZip(info)).rejects.toBeInstanceOf(GitHubDownloadError);
+ });
+
+ it('reports a missing ref as not found', async () => {
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue(new Response('', { status: 404 })));
+
+ await expect(gh.downloadRefZip(info)).rejects.toBeInstanceOf(GitHubNotFoundError);
+ });
+ });
+
describe('github singleton', () => {
it('should be an instance of GitHub', () => {
expect(github).toBeInstanceOf(GitHub);
diff --git a/apps/server/src/modules/GitHub/index.ts b/apps/server/src/modules/GitHub/index.ts
index 87cd2a076b9..8e6340f23b1 100644
--- a/apps/server/src/modules/GitHub/index.ts
+++ b/apps/server/src/modules/GitHub/index.ts
@@ -155,6 +155,16 @@ export class GitHub {
headers: { 'Accept': 'application/vnd.github.sha', 'User-Agent': this.userAgent },
signal: AbortSignal.timeout(15_000),
});
+ // A missing repository answers 404, a missing ref answers 422.
+ if (response.status === 404 || response.status === 422)
+ throw new GitHubNotFoundError('GitHub repository or ref not found');
+ if (
+ response.status === 429 ||
+ (response.status === 403 &&
+ (response.headers.has('retry-after') ||
+ response.headers.get('x-ratelimit-remaining') === '0'))
+ )
+ throw new GitHubRateLimitError('GitHub rate limit reached');
if (!response.ok)
throw new GitHubDownloadError(`Could not resolve GitHub revision (HTTP ${response.status})`);
const commit = (await response.text()).trim();
@@ -165,7 +175,29 @@ export class GitHub {
async downloadCommitZip(info: GitHubRepoInfo, commit: string) {
if (!/^[a-f0-9]{40}$/.test(commit)) throw new GitHubParseError('Invalid commit SHA');
const url = `https://codeload.github.com/${encodeURIComponent(info.owner)}/${encodeURIComponent(info.repo)}/zip/${commit}`;
- const response = await fetch(url, { signal: AbortSignal.timeout(30_000) });
+ return this.readArchive(await fetch(url, { signal: AbortSignal.timeout(30_000) }));
+ }
+
+ /**
+ * Download a ref's archive and read the commit it was cut from out of the ZIP
+ * comment. Uses no REST API quota, so it still works when `resolveCommit` is
+ * rate limited.
+ */
+ async downloadRefZip(info: GitHubRepoInfo) {
+ const response = await fetch(this.buildRepoZipUrl(info), {
+ headers: { 'User-Agent': this.userAgent },
+ signal: AbortSignal.timeout(30_000),
+ });
+ if (response.status === 404)
+ throw new GitHubNotFoundError('GitHub repository or ref not found');
+ const buffer = await this.readArchive(response);
+ const commit = zipComment(buffer);
+ if (!/^[a-f0-9]{40}$/.test(commit))
+ throw new GitHubDownloadError('GitHub archive does not name its commit');
+ return { buffer, commit };
+ }
+
+ private async readArchive(response: Response) {
if (!response.ok || !response.body)
throw new GitHubDownloadError(`Could not download repository (HTTP ${response.status})`);
const reader = response.body.getReader();
@@ -300,4 +332,23 @@ export class GitHubDownloadError extends GitHubError {
}
}
+export class GitHubRateLimitError extends GitHubError {
+ constructor(message: string) {
+ super(message);
+ this.name = 'GitHubRateLimitError';
+ }
+}
+
+/** The archive comment sits after the end-of-central-directory record that closes a ZIP. */
+const zipComment = (zip: Buffer) => {
+ for (let at = zip.length - 22; at >= Math.max(0, zip.length - 22 - 0xff_ff); at--) {
+ if (
+ zip.readUInt32LE(at) === 0x06_05_4b_50 &&
+ at + 22 + zip.readUInt16LE(at + 20) === zip.length
+ )
+ return zip.toString('latin1', at + 22);
+ }
+ return '';
+};
+
export const github = new GitHub();
diff --git a/apps/server/src/modules/Redis/keys.ts b/apps/server/src/modules/Redis/keys.ts
index e777bcf8533..cd3e56be670 100644
--- a/apps/server/src/modules/Redis/keys.ts
+++ b/apps/server/src/modules/Redis/keys.ts
@@ -61,7 +61,8 @@ export const RedisKeyNamespace = {
*/
AI_GENERATION: 'aiGeneration',
/**
- * Third-party integrations (Linear, …): OAuth hand-off state.
+ * Third-party integrations (Linear, GitHub, …): OAuth hand-off state and
+ * short-lived answers from their APIs.
*/
INTEGRATIONS: 'integrations',
/**
@@ -310,6 +311,12 @@ export const RedisKeys = {
* Full key: integrations:connector_oauth_completion:v1:{flowId}
*/
connectorOAuthCompletion: (flowId: string): string => `connector_oauth_completion:v1:${flowId}`,
+ /**
+ * The commit a public GitHub ref pointed at when it was last resolved.
+ * Full key: integrations:github_ref_commit:v1:{owner}/{repo}:{ref}
+ */
+ gitHubRefCommit: (owner: string, repo: string, ref: string): string =>
+ `github_ref_commit:v1:${owner}/${repo}:${ref}`,
/**
* Single-use state of one "Connect Linear" OAuth hand-off.
* Full key: integrations:linear_oauth_state:v1:{state}
diff --git a/apps/server/src/routers/lambda/__tests__/integration/agentSkills.integration.test.ts b/apps/server/src/routers/lambda/__tests__/integration/agentSkills.integration.test.ts
index 13b013e0011..f8f65d74e2e 100644
--- a/apps/server/src/routers/lambda/__tests__/integration/agentSkills.integration.test.ts
+++ b/apps/server/src/routers/lambda/__tests__/integration/agentSkills.integration.test.ts
@@ -59,7 +59,8 @@ const normalizeIdentifierPart = (part: string) =>
.replaceAll(/^-|-$/g, '');
const mockGitHubInstance = {
- downloadRepoZip: vi.fn(),
+ downloadCommitZip: vi.fn(),
+ resolveCommit: vi.fn().mockResolvedValue('a'.repeat(40)),
generateIdentifier: vi.fn().mockImplementation(function (info: {
owner: string;
path?: string;
@@ -901,7 +902,7 @@ Body`,
path: 'skills/skill-creator',
repo: 'openclaw',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('mock-zip-content'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('mock-zip-content'));
mockParserInstance.parseZipPackage.mockResolvedValue({
content: '# Skill Creator\n\nCreate skills easily.',
manifest: { name: 'skill-creator', description: 'Create skills' },
@@ -946,7 +947,7 @@ Body`,
path: 'skills/demo',
repo: 'skills',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('mock-zip'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('mock-zip'));
let callCount = 0;
mockParserInstance.parseZipPackage.mockImplementation(function () {
diff --git a/apps/server/src/routers/lambda/agentSkills.ts b/apps/server/src/routers/lambda/agentSkills.ts
index 02c7eb38de6..646f7425178 100644
--- a/apps/server/src/routers/lambda/agentSkills.ts
+++ b/apps/server/src/routers/lambda/agentSkills.ts
@@ -198,6 +198,31 @@ export const agentSkillsRouter = router({
return ctx.skillModel.findByName(input.name);
}),
+ checkGitHubUpdates: skillProcedure.query(({ ctx }) => ctx.skillImporter.checkGitHubUpdates()),
+
+ applyGitHubUpdate: skillWriteProcedure
+ .input(
+ z.object({
+ id: z.string(),
+ commit: z.string().regex(/^[a-f0-9]{40}$/),
+ revision: z.string(),
+ overwriteLocal: z.boolean().optional(),
+ }),
+ )
+ .mutation(({ ctx, input }) =>
+ ctx.skillImporter.applyGitHubUpdate(input).catch(handleSkillImportError),
+ ),
+
+ trackLegacyGitHubSkill: skillWriteProcedure
+ .input(
+ z.object({ id: z.string(), revision: z.string(), ref: z.string().trim().min(1).max(255) }),
+ )
+ .mutation(({ ctx, input }) =>
+ ctx.skillImporter
+ .trackLegacyGitHubSkill(input.id, input.revision, input.ref)
+ .catch(handleSkillImportError),
+ ),
+
discoverGitHubSkills: skillWriteProcedure
.input(z.object({ gitUrl: z.string().url() }))
.mutation(({ ctx, input }) => ctx.skillImporter.discoverGitHubSkills(input.gitUrl)),
diff --git a/apps/server/src/services/redis/README.md b/apps/server/src/services/redis/README.md
index c037b0acd89..c3416c2cb82 100644
--- a/apps/server/src/services/redis/README.md
+++ b/apps/server/src/services/redis/README.md
@@ -19,6 +19,9 @@ callers do not choose a provider, prefix, key, SET options or claim lifetime.
per user and hashed key. Every method returns `undefined` without Redis; the REST layer then
admits the request (fail open).
- `linear`: single-use OAuth state for "Connect Linear" (ten minutes, deleted on first read).
+- `gitHubRefs`: the commit a public GitHub ref points at, shared by every user's skill update
+ check for five minutes. `record` replaces it with a commit an import just resolved live.
+ Without Redis each check resolves live.
- `connectorOAuth`: how each connector OAuth flow ended (account and outcome), for ten minutes,
read back by the window that started the flow. `null` without Redis.
- `agentDocumentIndex`: the agent-document index snapshot and change notes one conversation
diff --git a/apps/server/src/services/redis/gitHubRefs.test.ts b/apps/server/src/services/redis/gitHubRefs.test.ts
new file mode 100644
index 00000000000..c9cd5b12248
--- /dev/null
+++ b/apps/server/src/services/redis/gitHubRefs.test.ts
@@ -0,0 +1,86 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+import { gitHubRefs } from './gitHubRefs';
+
+const store = new Map<string, string>();
+const redis = vi.hoisted(() => ({ client: null as any }));
+vi.mock('./client', () => ({ getRedisServiceClient: async () => redis.client }));
+
+const memoryClient = {
+ get: vi.fn(async (key: string) => store.get(key) ?? null),
+ set: vi.fn(async (key: string, value: string, options?: { nx?: boolean }) => {
+ if (options?.nx && store.has(key)) return null;
+ store.set(key, value);
+ return 'OK';
+ }),
+};
+
+const ref = { branch: 'main', owner: 'LobeHub', repo: 'Skills' };
+const first = 'a'.repeat(40);
+const next = 'b'.repeat(40);
+
+beforeEach(() => {
+ store.clear();
+ vi.clearAllMocks();
+ redis.client = memoryClient;
+});
+
+describe('redisService.gitHubRefs', () => {
+ it('resolves a ref once for every check that shares it', async () => {
+ const resolve = vi.fn().mockResolvedValue(first);
+
+ expect(await gitHubRefs.remember(ref, resolve)).toBe(first);
+ await vi.waitFor(() => expect(store.size).toBe(1));
+ expect(await gitHubRefs.remember({ ...ref, owner: 'lobehub', repo: 'skills' }, resolve)).toBe(
+ first,
+ );
+
+ expect(resolve).toHaveBeenCalledTimes(1);
+ expect(memoryClient.set).toHaveBeenCalledWith(
+ 'github_ref_commit:v1:lobehub/skills:main',
+ JSON.stringify(first),
+ { nx: true, px: 5 * 60 * 1000 },
+ );
+ });
+
+ it('serves the commit an import just recorded instead of the remembered one', async () => {
+ await gitHubRefs.record(ref, first);
+ await gitHubRefs.record(ref, next);
+
+ const resolve = vi.fn();
+ expect(await gitHubRefs.remember(ref, resolve)).toBe(next);
+ expect(resolve).not.toHaveBeenCalled();
+ });
+
+ it('keeps the import ref when an earlier cache miss finishes later', async () => {
+ const lookup = Promise.withResolvers<string>();
+ const resolve = vi.fn(() => lookup.promise);
+ const checking = gitHubRefs.remember(ref, resolve);
+ await vi.waitFor(() => expect(resolve).toHaveBeenCalledOnce());
+
+ await gitHubRefs.record(ref, next);
+ lookup.resolve(first);
+
+ expect(await checking).toBe(next);
+ expect(await gitHubRefs.remember(ref, resolve)).toBe(next);
+ expect(resolve).toHaveBeenCalledOnce();
+ });
+
+ it('does not remember a failed resolution', async () => {
+ await expect(
+ gitHubRefs.remember(ref, () => Promise.reject(new Error('rate limited'))),
+ ).rejects.toThrow('rate limited');
+
+ expect(await gitHubRefs.remember(ref, async () => first)).toBe(first);
+ });
+
+ it('resolves live without Redis', async () => {
+ redis.client = null;
+ const resolve = vi.fn().mockResolvedValue(first);
+
+ await gitHubRefs.record(ref, next);
+ expect(await gitHubRefs.remember(ref, resolve)).toBe(first);
+ expect(await gitHubRefs.remember(ref, resolve)).toBe(first);
+ expect(resolve).toHaveBeenCalledTimes(2);
+ });
+});
diff --git a/apps/server/src/services/redis/gitHubRefs.ts b/apps/server/src/services/redis/gitHubRefs.ts
new file mode 100644
index 00000000000..07d86809e74
--- /dev/null
+++ b/apps/server/src/services/redis/gitHubRefs.ts
@@ -0,0 +1,49 @@
+import { getJSONFromRedis, RedisKeys } from '@/server/modules/Redis';
+
+import { getRedisServiceClient } from './client';
+
+const TTL_MS = 5 * 60 * 1000;
+
+interface GitHubRef {
+ branch: string;
+ owner: string;
+ repo: string;
+}
+
+const getClient = () => getRedisServiceClient('integrations');
+const keyOf = ({ branch, owner, repo }: GitHubRef) =>
+ RedisKeys.integrations.gitHubRefCommit(owner.toLowerCase(), repo.toLowerCase(), branch);
+
+export const gitHubRefs = {
+ /**
+ * The commit a ref points at, shared by every user's update check for five
+ * minutes. Refs are resolved without credentials, so the answer is public and
+ * the lookups draw on one small per-address GitHub quota. Without Redis each
+ * check resolves live.
+ */
+ async remember(ref: GitHubRef, resolve: () => Promise<string>): Promise<string> {
+ const redis = await getClient();
+ if (!redis) return resolve();
+
+ const key = keyOf(ref);
+ const readCached = () => getJSONFromRedis<string>(redis, key).catch(() => null);
+ const cached = await readCached();
+ if (cached !== null) return cached;
+
+ const commit = await resolve();
+ // An import may have recorded a newer ref while GitHub was responding.
+ const stored = await redis
+ .set(key, JSON.stringify(commit), { nx: true, px: TTL_MS })
+ .catch(() => undefined);
+ if (stored === null) return (await readCached()) ?? commit;
+ return commit;
+ },
+
+ /**
+ * An import records its live ref before saving the installation.
+ */
+ async record(ref: GitHubRef, commit: string): Promise<void> {
+ const redis = await getClient();
+ await redis?.set(keyOf(ref), JSON.stringify(commit), { px: TTL_MS }).catch(() => undefined);
+ },
+};
diff --git a/apps/server/src/services/redis/index.ts b/apps/server/src/services/redis/index.ts
index dae08e79af9..9c213d8735f 100644
--- a/apps/server/src/services/redis/index.ts
+++ b/apps/server/src/services/redis/index.ts
@@ -7,6 +7,7 @@ import { botReply } from './botReply';
import { botWake } from './botWake';
import { connectorOAuth } from './connectorOAuth';
import { deviceSystemInfo } from './deviceSystemInfo';
+import { gitHubRefs } from './gitHubRefs';
import { heteroControl } from './heteroControl';
import { inboundWebhook } from './inboundWebhook';
import { linear } from './linear';
@@ -30,6 +31,7 @@ export const redisService = {
botWake,
connectorOAuth,
deviceSystemInfo,
+ gitHubRefs,
heteroControl,
inboundWebhook,
linear,
diff --git a/apps/server/src/services/skill/githubArchive.ts b/apps/server/src/services/skill/githubArchive.ts
index 90306eff843..5c33db1b940 100644
--- a/apps/server/src/services/skill/githubArchive.ts
+++ b/apps/server/src/services/skill/githubArchive.ts
@@ -9,7 +9,8 @@ export interface GitHubSkillDirectory {
const ignored = new Set(['.git', 'node_modules', '__MACOSX']);
-export async function readGitHubArchive(buffer: Buffer, basePath = '') {
+export async function readGitHubArchive(buffer: Buffer, basePath: string | string[] = '') {
+ const pathsToRead = Array.isArray(basePath) ? basePath : [basePath];
let count = 0;
let size = 0;
const files = await new Promise<Record<string, Uint8Array>>((resolve, reject) => {
@@ -20,7 +21,7 @@ export async function readGitHubArchive(buffer: Buffer, basePath = '') {
if (++count > 50_000)
throw new SkillParseError('Repository exceeds the file-count limit');
const relative = entry.name.slice(entry.name.indexOf('/') + 1);
- if (basePath && !relative.startsWith(basePath + '/')) return false;
+ if (!pathsToRead.some((path) => !path || relative.startsWith(path + '/'))) return false;
size += entry.originalSize;
if (size > 128 * 1024 * 1024)
throw new SkillParseError('Repository exceeds the archive scan limit');
diff --git a/apps/server/src/services/skill/githubUpdates.ts b/apps/server/src/services/skill/githubUpdates.ts
new file mode 100644
index 00000000000..fe4ef887131
--- /dev/null
+++ b/apps/server/src/services/skill/githubUpdates.ts
@@ -0,0 +1,145 @@
+import { createHash } from 'node:crypto';
+
+import type { GitHubSkillCheck, SkillItem } from '@lobechat/types';
+import pMap from 'p-map';
+
+import { type GitHub, GitHubRateLimitError, type GitHubRepoInfo } from '@/server/modules/GitHub';
+import { redisService } from '@/server/services/redis';
+
+import { readGitHubArchive } from './githubArchive';
+import type { SkillParser } from './parser';
+
+export const isCommit = (ref: string) => /^[a-f0-9]{40}$/i.test(ref);
+
+// A legacy URL can identify the installed snapshot without identifying its branch.
+// A bare URL may also have been imported with a separate CLI --branch argument.
+export const needsTrackingRef = (skill: SkillItem, info: GitHubRepoInfo) =>
+ !skill.upstream && (!info.branch || isCommit(info.branch));
+
+export const revisionOf = (skill: Pick<SkillItem, 'id' | 'updatedAt'>) =>
+ skill.id + '/' + skill.updatedAt.toISOString();
+
+export function installedFingerprint(
+ skill: Pick<SkillItem, 'content' | 'manifest' | 'name' | 'description' | 'resources'>,
+) {
+ // Postgres JSONB does not preserve object key order.
+ const serialized = JSON.stringify(
+ [skill.content, skill.name, skill.description, skill.manifest, skill.resources],
+ (_, value) =>
+ value && typeof value === 'object' && !Array.isArray(value)
+ ? Object.fromEntries(
+ Object.keys(value)
+ .sort()
+ .map((key) => [key, value[key]]),
+ )
+ : value,
+ );
+ return createHash('sha256').update(serialized).digest('hex');
+}
+
+type TrackedRow = { info: GitHubRepoInfo; skill: SkillItem };
+
+/** A ref is resolved once per check. Cache only immutable package hashes, never ZIP buffers. */
+const packageHashes = new Map<string, string | null>();
+
+async function readPackageHashes(
+ github: GitHub,
+ parser: SkillParser,
+ info: GitHubRepoInfo,
+ commit: string,
+ paths: Set<string>,
+) {
+ const hashes = new Map<string, string | null>();
+ const pending = [];
+ const key = (path: string) =>
+ JSON.stringify([info.owner.toLowerCase(), info.repo.toLowerCase(), commit, path]);
+ for (const path of paths) {
+ const cached = packageHashes.get(key(path));
+ if (cached === undefined) pending.push(path);
+ else hashes.set(path, cached);
+ }
+ if (!pending.length) return hashes;
+
+ const archive = await readGitHubArchive(await github.downloadCommitZip(info, commit), pending);
+ for (const path of pending) {
+ const directory = archive.get(path);
+ try {
+ const hash = directory
+ ? (await parser.parseGitHubDirectory(directory, path.split('/').at(-1) || info.repo))
+ .zipHash
+ : null;
+ if (hash === undefined) continue;
+ hashes.set(path, hash);
+ if (packageHashes.size >= 2048) {
+ const oldest = packageHashes.keys().next();
+ if (!oldest.done) packageHashes.delete(oldest.value);
+ }
+ packageHashes.set(key(path), hash);
+ } catch {
+ // This directory is malformed. Other installed skills can still be checked.
+ }
+ }
+ return hashes;
+}
+
+export async function checkGitHubRows(rows: TrackedRow[], github: GitHub, parser: SkillParser) {
+ const results: Record<string, GitHubSkillCheck> = {};
+ const groups = new Map<string, TrackedRow[]>();
+ for (const row of rows) {
+ const { skill, info } = row;
+ if (needsTrackingRef(skill, info)) {
+ results[skill.id] = { revision: revisionOf(skill), status: 'chooseRef' };
+ continue;
+ }
+ if (isCommit(info.branch)) {
+ results[skill.id] = { status: 'pinned' };
+ continue;
+ }
+ const key = JSON.stringify([info.owner.toLowerCase(), info.repo.toLowerCase(), info.branch]);
+ const group = groups.get(key) ?? [];
+ group.push(row);
+ groups.set(key, group);
+ }
+ let limited = false;
+ await pMap(
+ groups.values(),
+ async (group) => {
+ try {
+ if (limited) {
+ for (const { skill } of group) results[skill.id] = { status: 'limited' };
+ return;
+ }
+ const { info } = group[0];
+ const commit = await redisService.gitHubRefs.remember(info, () =>
+ github.resolveCommit(info),
+ );
+ const changed = group.filter(({ skill }) => {
+ if (skill.upstream?.installedCommit !== commit) return true;
+ results[skill.id] = { status: 'current' };
+ return false;
+ });
+ const paths = new Set(changed.map(({ info }) => info.path ?? ''));
+ const hashes = await readPackageHashes(github, parser, info, commit, paths);
+ for (const { info: source, skill } of changed) {
+ const hash = hashes.get(source.path ?? '');
+ if (hash === undefined) results[skill.id] = { status: 'unavailable' };
+ else if (hash === null) results[skill.id] = { status: 'missing' };
+ else if (hash === skill.zipFileHash) results[skill.id] = { status: 'current' };
+ else
+ results[skill.id] = {
+ commit,
+ localChanges: skill.upstream?.installedFingerprint !== installedFingerprint(skill),
+ revision: revisionOf(skill),
+ status: 'update',
+ };
+ }
+ } catch (error) {
+ const status = error instanceof GitHubRateLimitError ? 'limited' : 'unavailable';
+ if (status === 'limited') limited = true;
+ for (const { skill } of group) results[skill.id] ??= { status };
+ }
+ },
+ { concurrency: 3 },
+ );
+ return results;
+}
diff --git a/apps/server/src/services/skill/importer.githubCollection.test.ts b/apps/server/src/services/skill/importer.githubCollection.test.ts
index d2f7d49b5a6..7e1375a4e48 100644
--- a/apps/server/src/services/skill/importer.githubCollection.test.ts
+++ b/apps/server/src/services/skill/importer.githubCollection.test.ts
@@ -8,7 +8,13 @@ import { strToU8, zipSync } from 'fflate';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { AgentSkillModel } from '@/database/models/agentSkill';
-import { GitHub } from '@/server/modules/GitHub';
+import {
+ GitHub,
+ GitHubDownloadError,
+ GitHubNotFoundError,
+ GitHubRateLimitError,
+} from '@/server/modules/GitHub';
+import { redisService } from '@/server/services/redis';
import { SkillImporter } from './importer';
@@ -45,7 +51,6 @@ describe('GitHub skill collection import', () => {
model = new AgentSkillModel(db, userId);
vi.spyOn(GitHub.prototype, 'resolveCommit').mockResolvedValue(commit);
vi.spyOn(GitHub.prototype, 'downloadCommitZip').mockResolvedValue(zip);
- vi.spyOn(GitHub.prototype, 'downloadRepoZip').mockResolvedValue(zip);
});
afterEach(async () => {
@@ -139,6 +144,241 @@ describe('GitHub skill collection import', () => {
expect((await model.findById(row.id))?.identifier).toBe(row.identifier);
});
+ it('checks a shared snapshot once, updates only the changed package and protects local edits', async () => {
+ const sibling = '.agents/skills/other';
+ const scan = await importer.discoverGitHubSkills(repo);
+ await importer.importGitHubSkills({
+ ...scan,
+ gitUrl: repo,
+ selections: [review, sibling].map((path) => ({ path, revision: null })),
+ });
+ const a = (await model.findByName('review'))!;
+ const b = (await model.findByName('other'))!;
+ expect(a.upstream).toMatchObject({ path: review, ref: 'HEAD', installedCommit: commit });
+ const next = 'b'.repeat(40);
+ vi.mocked(GitHub.prototype.resolveCommit).mockResolvedValue(next);
+ vi.mocked(GitHub.prototype.downloadCommitZip)
+ .mockClear()
+ .mockResolvedValue(
+ Buffer.from(
+ zipSync({
+ ['repo-new/' + review + '/SKILL.md']: doc('review'),
+ ['repo-new/' + review + '/scripts/run.sh']: strToU8('echo updated'),
+ ['repo-new/' + sibling + '/SKILL.md']: doc('other'),
+ }),
+ ),
+ );
+ const checks = await importer.checkGitHubUpdates();
+ expect(checks[a.id]).toMatchObject({ commit: next, localChanges: false, status: 'update' });
+ expect(checks[b.id]).toEqual({ status: 'current' });
+ expect(GitHub.prototype.downloadCommitZip).toHaveBeenCalledTimes(1);
+ const before = checks[a.id];
+ if (before.status !== 'update') throw new Error('Expected update');
+ await model.update(a.id, { content: 'My edited instructions' });
+ await expect(importer.applyGitHubUpdate({ ...before, id: a.id })).rejects.toThrow(/changed/);
+ const edited = (await importer.checkGitHubUpdates())[a.id];
+ if (edited.status !== 'update') throw new Error('Expected update');
+ expect(edited.localChanges).toBe(true);
+ await expect(importer.applyGitHubUpdate({ ...edited, id: a.id })).rejects.toThrow(
+ /local changes/,
+ );
+ expect((await model.findById(a.id))?.content).toBe('My edited instructions');
+ const result = await importer.applyGitHubUpdate({ ...edited, id: a.id, overwriteLocal: true });
+ expect(result.skill).toMatchObject({
+ id: a.id,
+ identifier: a.identifier,
+ upstream: { installedCommit: next },
+ });
+ expect(result.skill.resources?.['scripts/run.sh']).toBeDefined();
+ expect((await model.findById(b.id))?.zipFileHash).toEqual(b.zipFileHash);
+ expect((await importer.checkGitHubUpdates())[a.id]).toEqual({ status: 'current' });
+ });
+
+ it('applies the previewed commit with one click even if the branch advances again', async () => {
+ const { skill } = await importer.importFromGitHub({ gitUrl: repo + '/tree/release/' + review });
+ const next = 'd'.repeat(40);
+ vi.mocked(GitHub.prototype.resolveCommit).mockResolvedValue(next);
+ vi.mocked(GitHub.prototype.downloadCommitZip).mockResolvedValue(
+ Buffer.from(
+ zipSync({
+ ['repo-new/' + review + '/SKILL.md']: strToU8(
+ '---\nname: review\ndescription: Updated\n---\nUse the new instructions',
+ ),
+ }),
+ ),
+ );
+ const preview = (await importer.checkGitHubUpdates())[skill.id];
+ if (preview.status !== 'update') throw new Error('Expected update');
+ expect(preview.localChanges).toBe(false);
+ vi.mocked(GitHub.prototype.resolveCommit).mockResolvedValue('e'.repeat(40));
+ const { skill: updated } = await importer.applyGitHubUpdate({ id: skill.id, ...preview });
+ expect(updated).toMatchObject({
+ id: skill.id,
+ identifier: skill.identifier,
+ upstream: { ref: 'release', installedCommit: next },
+ });
+ expect(updated.content).toContain('Use the new instructions');
+ expect(GitHub.prototype.downloadCommitZip).toHaveBeenLastCalledWith(expect.anything(), next);
+ });
+
+ it('requires a branch choice for a legacy CLI install whose URL omitted --branch', async () => {
+ const rootZip = (name: string) => Buffer.from(zipSync({ 'repo/SKILL.md': doc(name) }));
+ vi.mocked(GitHub.prototype.downloadCommitZip).mockResolvedValue(rootZip('original'));
+ const { skill } = await importer.importFromGitHub({ branch: 'release', gitUrl: repo });
+ await model.replaceImportedSkill(skill, { upstream: null });
+
+ vi.mocked(GitHub.prototype.resolveCommit).mockClear().mockResolvedValue('9'.repeat(40));
+ vi.mocked(GitHub.prototype.downloadCommitZip).mockResolvedValue(rootZip('changed'));
+ const check = (await importer.checkGitHubUpdates())[skill.id];
+ expect(check.status).toBe('chooseRef');
+ if (check.status !== 'chooseRef') throw new Error('Expected branch choice');
+ expect(GitHub.prototype.resolveCommit).not.toHaveBeenCalled();
+ await expect(
+ importer.applyGitHubUpdate({
+ id: skill.id,
+ revision: check.revision,
+ commit,
+ overwriteLocal: true,
+ }),
+ ).rejects.toMatchObject({ code: 'CONFLICT' });
+
+ const tracked = await importer.trackLegacyGitHubSkill(skill.id, check.revision, 'release');
+ expect(tracked.upstream?.ref).toBe('release');
+ expect(tracked.upstream?.installedCommit).toBeUndefined();
+ expect(tracked.name).toBe('original');
+ const update = (await importer.checkGitHubUpdates())[skill.id];
+ expect(update).toMatchObject({ commit: '9'.repeat(40), localChanges: true, status: 'update' });
+ expect(GitHub.prototype.resolveCommit).toHaveBeenLastCalledWith(
+ expect.objectContaining({ branch: 'release' }),
+ );
+ });
+
+ it('checks the branch explicitly named by a legacy source URL', async () => {
+ const { skill } = await importer.importFromGitHub({ gitUrl: repo + '/tree/release/' + review });
+ await model.replaceImportedSkill(skill, { upstream: null });
+ vi.mocked(GitHub.prototype.resolveCommit).mockClear();
+
+ expect((await importer.checkGitHubUpdates())[skill.id]).toEqual({ status: 'current' });
+ expect(GitHub.prototype.resolveCommit).toHaveBeenCalledWith(
+ expect.objectContaining({ branch: 'release' }),
+ );
+ });
+
+ it('keeps explicit commit installs pinned and lets a legacy snapshot opt into a branch', async () => {
+ const { skill } = await importer.importFromGitHub({
+ gitUrl: repo + '/tree/' + commit + '/' + review,
+ });
+ expect((await importer.checkGitHubUpdates())[skill.id]).toEqual({ status: 'pinned' });
+ await model.replaceImportedSkill(skill, { upstream: null });
+ const legacy = (await importer.checkGitHubUpdates())[skill.id];
+ if (legacy.status !== 'chooseRef') throw new Error('Expected branch choice');
+ await importer.trackLegacyGitHubSkill(skill.id, legacy.revision, 'release/stable');
+ expect((await model.findById(skill.id))?.upstream).toMatchObject({
+ ref: 'release/stable',
+ installedCommit: commit,
+ });
+ });
+
+ it('reports a removed directory separately from an unavailable source and keeps the installation', async () => {
+ const { skill } = await importer.importFromGitHub({ gitUrl: repo + '/tree/main/' + review });
+ vi.mocked(GitHub.prototype.resolveCommit).mockResolvedValue('c'.repeat(40));
+ vi.mocked(GitHub.prototype.downloadCommitZip).mockResolvedValue(
+ Buffer.from(zipSync({ 'repo-new/README.md': doc('docs') })),
+ );
+ expect((await importer.checkGitHubUpdates())[skill.id]).toEqual({ status: 'missing' });
+ vi.mocked(GitHub.prototype.resolveCommit).mockRejectedValue(new Error('offline'));
+ expect((await importer.checkGitHubUpdates())[skill.id]).toEqual({ status: 'unavailable' });
+ expect((await model.findById(skill.id))?.zipFileHash).toEqual(skill.zipFileHash);
+ });
+
+ it('imports from the ref archive when the commit lookup is rate limited', async () => {
+ const archived = 'f'.repeat(40);
+ vi.mocked(GitHub.prototype.resolveCommit).mockRejectedValue(
+ new GitHubRateLimitError('GitHub rate limit reached'),
+ );
+ const downloadRefZip = vi
+ .spyOn(GitHub.prototype, 'downloadRefZip')
+ .mockResolvedValue({ buffer: zip, commit: archived });
+ const record = vi.spyOn(redisService.gitHubRefs, 'record');
+
+ const { skill, status } = await importer.importFromGitHub({
+ gitUrl: repo + '/tree/main/' + review,
+ });
+
+ expect(status).toBe('created');
+ expect(skill.upstream).toMatchObject({ ref: 'main', installedCommit: archived });
+ expect(GitHub.prototype.downloadCommitZip).not.toHaveBeenCalled();
+ expect(record).toHaveBeenCalledWith(expect.objectContaining({ branch: 'main' }), archived);
+
+ downloadRefZip.mockRejectedValue(new GitHubNotFoundError('GitHub repository or ref not found'));
+ await expect(
+ importer.importFromGitHub({ gitUrl: repo + '/tree/v1.0.0/' + other }),
+ ).rejects.toMatchObject({ code: 'DOWNLOAD_FAILED', message: /rate limit/ });
+ });
+
+ it('shares one commit lookup between checks and reports the limit when there is none', async () => {
+ const { skill } = await importer.importFromGitHub({ gitUrl: repo + '/tree/main/' + review });
+ vi.mocked(GitHub.prototype.resolveCommit).mockClear();
+ const remember = vi.spyOn(redisService.gitHubRefs, 'remember').mockResolvedValue(commit);
+
+ expect((await importer.checkGitHubUpdates())[skill.id]).toEqual({ status: 'current' });
+ expect(remember).toHaveBeenCalledWith(
+ expect.objectContaining({ branch: 'main', owner: 'owner', repo: 'collection' }),
+ expect.any(Function),
+ );
+ expect(GitHub.prototype.resolveCommit).not.toHaveBeenCalled();
+
+ remember.mockRestore();
+ vi.mocked(GitHub.prototype.resolveCommit).mockRejectedValue(
+ new GitHubRateLimitError('GitHub rate limit reached'),
+ );
+ expect((await importer.checkGitHubUpdates())[skill.id]).toEqual({ status: 'limited' });
+ });
+
+ it('reports GitHub and package failures of an update or a branch choice as import errors', async () => {
+ const pinned = await importer.importFromGitHub({
+ gitUrl: repo + '/tree/' + commit + '/' + review,
+ });
+ await model.replaceImportedSkill(pinned.skill, { upstream: null });
+ const legacy = (await importer.checkGitHubUpdates())[pinned.skill.id];
+ if (legacy.status !== 'chooseRef') throw new Error('Expected branch choice');
+ vi.mocked(GitHub.prototype.resolveCommit).mockRejectedValueOnce(
+ new GitHubNotFoundError('GitHub repository or ref not found'),
+ );
+ await expect(
+ importer.trackLegacyGitHubSkill(pinned.skill.id, legacy.revision, 'no-such-branch'),
+ ).rejects.toMatchObject({ code: 'NOT_FOUND', name: 'SkillImportError' });
+ expect((await model.findById(pinned.skill.id))?.upstream).toBeNull();
+
+ const next = 'b'.repeat(40);
+ const sibling = '.agents/skills/other';
+ const tracked = await importer.importFromGitHub({ gitUrl: repo + '/tree/main/' + sibling });
+ const update = {
+ commit: next,
+ id: tracked.skill.id,
+ revision: tracked.skill.id + '/' + tracked.skill.updatedAt.toISOString(),
+ };
+ vi.mocked(GitHub.prototype.downloadCommitZip).mockRejectedValue(
+ new GitHubDownloadError('Repository exceeds the 32 MiB download limit'),
+ );
+ await expect(importer.applyGitHubUpdate(update)).rejects.toMatchObject({
+ code: 'DOWNLOAD_FAILED',
+ message: /32 MiB/,
+ });
+ vi.mocked(GitHub.prototype.downloadCommitZip).mockResolvedValue(
+ Buffer.from(
+ zipSync({ ['repo-new/' + sibling + '/SKILL.md']: strToU8('---\nname: nope\n---') }),
+ ),
+ );
+ await expect(importer.applyGitHubUpdate(update)).rejects.toMatchObject({
+ code: 'DOWNLOAD_FAILED',
+ name: 'SkillImportError',
+ });
+ expect((await model.findById(tracked.skill.id))?.zipFileHash).toEqual(
+ tracked.skill.zipFileHash,
+ );
+ });
+
it('checks the library and creator permissions again when committing', async () => {
const workspaceId = randomUUID();
await db.insert(workspaces).values({
diff --git a/apps/server/src/services/skill/importer.test.ts b/apps/server/src/services/skill/importer.test.ts
index 9bc0d038abd..154b98fe13e 100644
--- a/apps/server/src/services/skill/importer.test.ts
+++ b/apps/server/src/services/skill/importer.test.ts
@@ -17,9 +17,9 @@ const normalizeIdentifierPart = (part: string) =>
.replaceAll(/[^\w-]/g, '-')
.replaceAll(/-+/g, '-')
.replaceAll(/^-|-$/g, '');
-
const mockGitHubInstance = {
- downloadRepoZip: vi.fn(),
+ downloadCommitZip: vi.fn(),
+ resolveCommit: vi.fn().mockResolvedValue('a'.repeat(40)),
generateIdentifier: vi
.fn()
.mockImplementation((info: { owner: string; path?: string; repo: string }) => {
@@ -36,6 +36,8 @@ vi.mock('@/server/modules/GitHub', () => ({
GitHub: vi.fn(function () {
return mockGitHubInstance;
}),
+ GitHubError: class GitHubError extends Error {},
+ GitHubRateLimitError: class GitHubRateLimitError extends Error {},
GitHubNotFoundError: class GitHubNotFoundError extends Error {
constructor(message: string) {
super(message);
@@ -369,7 +371,7 @@ describe('SkillImporter', () => {
owner: 'lobehub',
repo: 'skill-demo',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('mock-zip'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('mock-zip'));
mockParserInstance.parseZipPackage.mockResolvedValue({
content: '# GitHub Skill content',
manifest: { name: 'GitHub Skill', description: 'A GitHub skill' },
@@ -404,7 +406,7 @@ describe('SkillImporter', () => {
path: 'skills/skill-creator',
repo: 'openclaw',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('mock-zip'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('mock-zip'));
mockParserInstance.parseZipPackage.mockResolvedValue({
content: '# Skill Creator content',
manifest: { name: 'skill-creator', description: 'Create skills' },
@@ -433,7 +435,7 @@ describe('SkillImporter', () => {
owner: 'lobehub',
repo: 'skill-update',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('mock-zip'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('mock-zip'));
// First import
mockParserInstance.parseZipPackage.mockResolvedValueOnce({
@@ -502,19 +504,13 @@ describe('SkillImporter', () => {
owner: 'lobehub',
repo: 'non-existent',
});
- mockGitHubInstance.downloadRepoZip.mockImplementation(() => {
- throw new GitHubNotFoundError('Repository not found');
- });
+ mockGitHubInstance.resolveCommit.mockRejectedValueOnce(
+ new GitHubNotFoundError('GitHub repository or ref not found'),
+ );
await expect(
importer.importFromGitHub({ gitUrl: 'https://github.com/lobehub/non-existent' }),
- ).rejects.toThrow(SkillImportError);
-
- try {
- await importer.importFromGitHub({ gitUrl: 'https://github.com/lobehub/non-existent' });
- } catch (e) {
- expect((e as SkillImportError).code).toBe('NOT_FOUND');
- }
+ ).rejects.toMatchObject({ code: 'NOT_FOUND', name: 'SkillImportError' });
});
it('should use custom branch when provided', async () => {
@@ -523,7 +519,7 @@ describe('SkillImporter', () => {
owner: 'lobehub',
repo: 'skill-branch',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('mock-zip'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('mock-zip'));
mockParserInstance.parseZipPackage.mockResolvedValue({
content: '# Branch Skill',
manifest: { name: 'Branch Skill', description: 'From develop branch' },
@@ -550,7 +546,7 @@ describe('SkillImporter', () => {
owner: 'lobehub',
repo: 'skill-global-only',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('mock-zip'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('mock-zip'));
mockParserInstance.parseZipPackage.mockResolvedValue({
content: '# Skill Content',
manifest: { name: 'Global Only Skill', description: 'Test global files' },
@@ -595,7 +591,7 @@ describe('SkillImporter', () => {
owner: 'lobehub',
repo: 'skill-path-test',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('mock-zip'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('mock-zip'));
mockParserInstance.parseZipPackage.mockResolvedValue({
content: '# Content',
manifest: { name: 'Path Test Skill', description: 'Test path' },
@@ -621,7 +617,7 @@ describe('SkillImporter', () => {
owner: 'lobehub',
repo: 'repack-test',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('large-repo-zip'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('large-repo-zip'));
mockParserInstance.parseZipPackage.mockResolvedValue({
content: '# Skill',
manifest: { name: 'Test', description: 'Test' },
@@ -655,7 +651,7 @@ describe('SkillImporter', () => {
owner: 'lobehub',
repo: 'large-repo',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(largeRepoZip);
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(largeRepoZip);
mockParserInstance.parseZipPackage.mockResolvedValue({
content: '# Skill',
manifest: { name: 'Test', description: 'Test' },
@@ -684,7 +680,7 @@ describe('SkillImporter', () => {
owner: 'lobehub',
repo: 'skill-dedup',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('mock-zip'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('mock-zip'));
mockParserInstance.parseZipPackage.mockResolvedValue({
content: '# Skill Content',
manifest: { name: 'Dedup Skill', description: 'Test deduplication' },
@@ -743,7 +739,7 @@ describe('SkillImporter', () => {
owner: 'lobehub',
repo: 'skill-update-content',
});
- mockGitHubInstance.downloadRepoZip.mockResolvedValue(Buffer.from('mock-zip'));
+ mockGitHubInstance.downloadCommitZip.mockResolvedValue(Buffer.from('mock-zip'));
// First import
mockParserInstance.parseZipPackage.mockResolvedValueOnce({
diff --git a/apps/server/src/services/skill/importer.ts b/apps/server/src/services/skill/importer.ts
index 20621342465..30bd941e839 100644
--- a/apps/server/src/services/skill/importer.ts
+++ b/apps/server/src/services/skill/importer.ts
@@ -23,22 +23,31 @@ import debug from 'debug';
import { AgentSkillModel } from '@/database/models/agentSkill';
import {
GitHub,
+ GitHubError,
GitHubNotFoundError,
GitHubParseError,
+ GitHubRateLimitError,
type GitHubRepoInfo,
} from '@/server/modules/GitHub';
import { FileService } from '@/server/services/file';
+import { redisService } from '@/server/services/redis';
-import { SkillImportError, SkillManifestError } from './errors';
+import { SkillImportError, SkillManifestError, SkillParseError } from './errors';
import { readGitHubArchive } from './githubArchive';
+import {
+ checkGitHubRows,
+ installedFingerprint,
+ isCommit,
+ needsTrackingRef,
+ revisionOf as installedRevision,
+} from './githubUpdates';
import { SkillParser } from './parser';
import { SkillResourceService } from './resource';
const sourceKey = (info: GitHubRepoInfo) =>
JSON.stringify([info.owner.toLowerCase(), info.repo.toLowerCase(), info.path ?? '']);
const digest = (value: string) => createHash('sha256').update(value).digest('hex');
-const revisionOf = (skill?: SkillItem) =>
- skill ? skill.id + '/' + skill.updatedAt.toISOString() : null;
+const revisionOf = (skill?: SkillItem) => (skill ? installedRevision(skill) : null);
const unchanged = (skill: SkillItem, parsed: ParsedZipSkill) =>
!!parsed.zipHash &&
skill.zipFileHash === parsed.zipHash &&
@@ -48,6 +57,18 @@ const unchanged = (skill: SkillItem, parsed: ParsedZipSkill) =>
const log = debug('lobe-chat:service:skill-importer');
+/** GitHub and package failures reach the client as import errors, not as a 500. */
+const asImportError = (error: unknown): never => {
+ if (error instanceof GitHubNotFoundError) throw new SkillImportError(error.message, 'NOT_FOUND');
+ if (
+ error instanceof GitHubError ||
+ error instanceof SkillParseError ||
+ error instanceof SkillManifestError
+ )
+ throw new SkillImportError(error.message, 'DOWNLOAD_FAILED');
+ throw error;
+};
+
export class SkillImporter {
private skillModel: AgentSkillModel;
private parser: SkillParser;
@@ -208,9 +229,10 @@ export class SkillImporter {
// 2. Download repository ZIP
let zipBuffer;
+ let commit: string;
try {
log('importFromGitHub: downloading repository ZIP...');
- zipBuffer = await this.github.downloadRepoZip(repoInfo);
+ ({ buffer: zipBuffer, commit } = await this.downloadRef(repoInfo));
log('importFromGitHub: downloaded ZIP size=%d bytes', zipBuffer.length);
} catch (error) {
log('importFromGitHub: download failed, error=%s', (error as Error).message);
@@ -230,7 +252,35 @@ export class SkillImporter {
fallbackName: repoInfo.path?.split('/').at(-1) || repoInfo.repo,
repackSkillZip: true,
});
- return this.saveGitHubSkill(repoInfo, input.gitUrl, parsed, zipBuffer);
+ return this.saveGitHubSkill(repoInfo, input.gitUrl, parsed, commit, zipBuffer);
+ }
+
+ /**
+ * Resolve a ref live. Update checks share the answer, so they never offer an
+ * older commit than the one this import is about to install.
+ */
+ private async resolveCommit(info: GitHubRepoInfo) {
+ const commit = await this.github.resolveCommit(info);
+ await redisService.gitHubRefs.record(info, commit);
+ return commit;
+ }
+
+ private async downloadRef(info: GitHubRepoInfo) {
+ try {
+ const commit = await this.resolveCommit(info);
+ return { buffer: await this.github.downloadCommitZip(info, commit), commit };
+ } catch (error) {
+ if (!(error instanceof GitHubRateLimitError)) throw error;
+ // The REST quota is shared by everyone behind this server's address. The
+ // ref's archive needs none of it and names the commit it was cut from.
+ log('downloadRef: rate limited, reading the commit from the ref archive');
+ const archive = await this.github.downloadRefZip(info).catch((fallback) => {
+ log('downloadRef: ref archive failed, error=%s', (fallback as Error).message);
+ throw error;
+ });
+ await redisService.gitHubRefs.record(info, archive.commit);
+ return archive;
+ }
}
private gitHubIdentifiers(info: GitHubRepoInfo) {
@@ -238,18 +288,122 @@ export class SkillImporter {
return { legacy, identifier: `${legacy}-${digest(sourceKey(info)).slice(0, 20)}` };
}
+ private installedSource(skill: SkillItem): GitHubRepoInfo | undefined {
+ if (skill.upstream) {
+ const { owner, repo, path, ref } = skill.upstream;
+ return { branch: ref, owner, path, repo };
+ }
+ if (skill.source !== 'market' || !skill.manifest.sourceUrl) return;
+ // A manifest may contain an author's repository link. Match the importer's
+ // identity as well before adopting a legacy row. Preserve a missing ref:
+ // older clients could send the branch separately from the URL.
+ try {
+ const info = this.github.parseRepoUrl(skill.manifest.sourceUrl, '');
+ const { identifier, legacy } = this.gitHubIdentifiers(info);
+ if (skill.identifier === identifier || skill.identifier === legacy) return info;
+ } catch {
+ return;
+ }
+ }
+
+ async checkGitHubUpdates() {
+ const rows = await this.skillModel.findGitHubInstalls();
+ return checkGitHubRows(
+ rows.flatMap((skill) => {
+ const info = this.installedSource(skill);
+ return info ? [{ info, skill }] : [];
+ }),
+ this.github,
+ this.parser,
+ );
+ }
+
+ private async installedForUpdate(id: string, revision: string) {
+ const skill = await this.skillModel.findById(id);
+ const info = skill && this.installedSource(skill);
+ if (!skill || !info) throw new SkillImportError('GitHub installation not found', 'NOT_FOUND');
+ this.assertCanOverwrite(skill);
+ if (revisionOf(skill) !== revision)
+ throw new SkillImportError(
+ 'The installed skill changed. Check for updates again.',
+ 'CONFLICT',
+ );
+ return { info, skill };
+ }
+
+ async trackLegacyGitHubSkill(id: string, revision: string, ref: string) {
+ const { info, skill } = await this.installedForUpdate(id, revision);
+ if (!needsTrackingRef(skill, info))
+ throw new SkillImportError('This skill already has a tracking ref', 'CONFLICT');
+ if (isCommit(ref)) throw new SkillImportError('Choose a tracking branch', 'INVALID_URL');
+ const tracking = { ...info, branch: ref };
+ const archive = await this.resolveCommit(tracking)
+ .then(async (commit) =>
+ readGitHubArchive(await this.github.downloadCommitZip(info, commit), info.path),
+ )
+ .catch(asImportError);
+ if (!archive.get(info.path ?? ''))
+ throw new SkillImportError('Skill not found on this branch', 'NOT_FOUND');
+ const row = await this.skillModel.replaceImportedSkill(skill, {
+ upstream: {
+ owner: info.owner,
+ repo: info.repo,
+ path: info.path ?? '',
+ ref,
+ installedCommit: info.branch || undefined,
+ },
+ });
+ if (!row) throw new SkillImportError('The installed skill changed', 'CONFLICT');
+ return row;
+ }
+
+ async applyGitHubUpdate(input: {
+ id: string;
+ commit: string;
+ revision: string;
+ overwriteLocal?: boolean;
+ }) {
+ const { info, skill } = await this.installedForUpdate(input.id, input.revision);
+ if (needsTrackingRef(skill, info))
+ throw new SkillImportError('Choose a tracking branch before updating', 'CONFLICT');
+ if (isCommit(info.branch))
+ throw new SkillImportError('This installation is pinned', 'CONFLICT');
+ if (
+ !input.overwriteLocal &&
+ skill.upstream?.installedFingerprint !== installedFingerprint(skill)
+ )
+ throw new SkillImportError('Confirm replacement of local changes', 'CONFLICT');
+ const parsed = await this.github
+ .downloadCommitZip(info, input.commit)
+ .then((buffer) =>
+ this.parser.parseZipPackage(buffer, {
+ basePath: info.path,
+ fallbackName: info.path?.split('/').at(-1) || info.repo,
+ repackSkillZip: true,
+ }),
+ )
+ .catch(asImportError);
+ return this.saveGitHubSkill(
+ info,
+ this.snapshotUrl(info, input.commit),
+ parsed,
+ input.commit,
+ undefined,
+ input.revision,
+ );
+ }
+
+ private snapshotUrl(info: GitHubRepoInfo, commit: string) {
+ return `https://github.com/${info.owner}/${info.repo}/tree/${commit}${info.path ? '/' + info.path.split('/').map(encodeURIComponent).join('/') : ''}`;
+ }
+
private gitHubTarget(info: GitHubRepoInfo, byIdentifier: Map<string, SkillItem>) {
const { identifier, legacy } = this.gitHubIdentifiers(info);
const exact = byIdentifier.get(identifier);
const existing = exact ?? byIdentifier.get(legacy);
- if (existing?.manifest.sourceUrl) {
- try {
- if (sourceKey(this.github.parseRepoUrl(existing.manifest.sourceUrl)) === sourceKey(info))
- return { existing, identifier: existing.identifier };
- } catch (error) {
- log('Ignoring unrecognized legacy source: %s', error);
- }
- }
+ const stored = existing && this.installedSource(existing);
+ if (existing && stored && sourceKey(stored) === sourceKey(info))
+ return { existing, identifier: existing.identifier };
if (exact) throw new SkillImportError('Source identifier already in use', 'CONFLICT');
return { existing: undefined, identifier };
}
@@ -258,17 +412,31 @@ export class SkillImporter {
info: GitHubRepoInfo,
sourceUrl: string,
parsed: ParsedZipSkill,
+ commit: string,
originalZip?: Buffer,
expectedRevision?: string | null,
): Promise<SkillImportResult> {
const { content, manifest, resources, zipHash, skillZipBuffer } = parsed;
+ const upstream = {
+ owner: info.owner,
+ repo: info.repo,
+ path: info.path ?? '',
+ ref: info.branch,
+ installedCommit: commit,
+ };
+ // Replaying a create-only batch may find the same package already installed.
+ // Leave its subsequent tracking choice alone.
+ const matches = (skill: SkillItem) =>
+ unchanged(skill, parsed) &&
+ (expectedRevision === null ||
+ (skill.upstream?.ref === info.branch && skill.upstream.installedCommit === commit));
const inspect = async (model: AgentSkillModel, expected?: string | null) => {
const { identifier, legacy } = this.gitHubIdentifiers(info);
const rows = await model.findImportMatches([identifier, legacy], [manifest.name]);
const target = this.gitHubTarget(info, new Map(rows.map((row) => [row.identifier, row])));
const { existing } = target;
- if (existing && unchanged(existing, parsed)) return target;
+ if (existing && matches(existing)) return target;
if (expected !== undefined && revisionOf(existing) !== expected)
throw new SkillImportError('The installed skill changed. Find skills again.', 'CONFLICT');
if (existing) this.assertCanOverwrite(existing);
@@ -278,9 +446,23 @@ export class SkillImporter {
return target;
};
const before = await inspect(this.skillModel, expectedRevision);
- if (before.existing && unchanged(before.existing, parsed))
+ if (before.existing && matches(before.existing))
return { skill: before.existing, status: 'unchanged' };
+ // An unchanged package can acquire tracking (or follow another branch)
+ // without uploading its resources again or replacing local metadata.
+ if (before.existing && unchanged(before.existing, parsed)) {
+ const skill = await this.skillModel.replaceImportedSkill(before.existing, {
+ upstream: {
+ ...upstream,
+ installedFingerprint: before.existing.upstream?.installedFingerprint,
+ },
+ });
+ if (!skill)
+ throw new SkillImportError('The installed skill changed. Find skills again.', 'CONFLICT');
+ return { skill, status: 'unchanged' };
+ }
+
// 6. Store resource files (only if skill is new or changed)
log('importFromGitHub: storing %d resources...', resources.size);
const resourceIds = zipHash
@@ -324,7 +506,7 @@ export class SkillImporter {
return this.skillModel.withImportLock(async (model) => {
const { identifier, existing } = await inspect(model, revisionOf(before.existing));
- if (existing && unchanged(existing, parsed)) return { skill: existing, status: 'unchanged' };
+ if (existing && matches(existing)) return { skill: existing, status: 'unchanged' };
const data = {
content,
description: manifest.description,
@@ -333,13 +515,22 @@ export class SkillImporter {
resources: resourceIds,
zipFileHash,
};
+ const tracking = { ...upstream, installedFingerprint: installedFingerprint(data) };
if (existing) {
- const skill = await model.replaceImportedSkill(existing, data);
+ const skill = await model.replaceImportedSkill(existing, {
+ ...data,
+ upstream: tracking,
+ });
if (!skill)
throw new SkillImportError('The installed skill changed. Find skills again.', 'CONFLICT');
- return { skill, status: 'updated' };
+ return { skill, status: unchanged(existing, parsed) ? 'unchanged' : 'updated' };
}
- const skill = await model.create({ ...data, identifier, source: 'market' });
+ const skill = await model.create({
+ ...data,
+ identifier,
+ source: 'market',
+ upstream: tracking,
+ });
return { skill, status: 'created' };
});
}
@@ -351,7 +542,7 @@ export class SkillImporter {
private async gitHubCollection(gitUrl: string, pinnedCommit?: string) {
const url = new URL(gitUrl);
const info = this.github.parseRepoUrl(url.origin + url.pathname.replace(/\/+$/, ''), 'HEAD');
- const commit = pinnedCommit ?? (await this.github.resolveCommit(info));
+ const commit = pinnedCommit ?? (await this.resolveCommit(info));
const base = info.path ?? '';
const archive = await readGitHubArchive(
await this.github.downloadCommitZip(info, commit),
@@ -448,11 +639,12 @@ export class SkillImporter {
directory,
path.split('/').at(-1) || info.repo,
);
- const sourceUrl = `https://github.com/${info.owner}/${info.repo}/tree/${input.commit}${path ? '/' + path.split('/').map(encodeURIComponent).join('/') : ''}`;
+ const sourceUrl = this.snapshotUrl({ ...info, path }, input.commit);
const result = await this.saveGitHubSkill(
{ ...info, path },
sourceUrl,
parsed,
+ input.commit,
undefined,
revision,
);
diff --git a/docs/development/database-schema.dbml b/docs/development/database-schema.dbml
index 44d0b7d64ba..f9475d91554 100644
--- a/docs/development/database-schema.dbml
+++ b/docs/development/database-schema.dbml
@@ -1145,6 +1145,7 @@ table agent_skills {
description text [not null]
identifier text [not null]
source text [not null]
+ upstream jsonb
manifest jsonb [not null, default: `{}`]
content text
editor_data jsonb
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index f08ac5eaf40..0c2eb8711f9 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -276,6 +276,22 @@
"agentSkillModal.url.title": "Import from URL",
"agentSkillModal.url.urlPlaceholder": "https://example.com/path/to/SKILL.md",
"agentSkillTag": "Agent Skill",
+ "agentSkillUpdate.apply": "Update skill",
+ "agentSkillUpdate.branch": "Branch name (HEAD follows the default branch)",
+ "agentSkillUpdate.check": "Check for updates",
+ "agentSkillUpdate.checking": "Checking GitHub…",
+ "agentSkillUpdate.chooseRef": "Choose a branch to track",
+ "agentSkillUpdate.current": "Up to date",
+ "agentSkillUpdate.failed": "Couldn’t update the skill",
+ "agentSkillUpdate.limited": "GitHub rate limit reached",
+ "agentSkillUpdate.missing": "Removed from the source repository",
+ "agentSkillUpdate.overwriteBody": "This update replaces your installed copy. It contains local changes or predates edit tracking.",
+ "agentSkillUpdate.overwriteTitle": "Replace the installed copy?",
+ "agentSkillUpdate.pinned": "Pinned to a commit",
+ "agentSkillUpdate.replace": "Replace and update",
+ "agentSkillUpdate.saved": "Skill synced with GitHub",
+ "agentSkillUpdate.track": "Track branch",
+ "agentSkillUpdate.unavailable": "Couldn’t check GitHub",
"agentTab.graph": "Graph Runtime",
"agentTab.opening": "Opening Settings",
"agentTab.plugin": "Skill Settings",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index 9f142969255..31c3e9cbd9f 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -276,6 +276,22 @@
"agentSkillModal.url.title": "从 URL 导入",
"agentSkillModal.url.urlPlaceholder": "https://example.com/path/to/SKILL.md",
"agentSkillTag": "Agent 技能",
+ "agentSkillUpdate.apply": "更新技能",
+ "agentSkillUpdate.branch": "分支名称(HEAD 跟踪默认分支)",
+ "agentSkillUpdate.check": "检查更新",
+ "agentSkillUpdate.checking": "正在检查 GitHub…",
+ "agentSkillUpdate.chooseRef": "选择要跟踪的分支",
+ "agentSkillUpdate.current": "已是最新",
+ "agentSkillUpdate.failed": "未能更新技能",
+ "agentSkillUpdate.limited": "已达到 GitHub 请求限额",
+ "agentSkillUpdate.missing": "源仓库中已移除",
+ "agentSkillUpdate.overwriteBody": "此次更新将替换已安装的副本。当前副本含有本地修改,或安装于支持修改跟踪之前。",
+ "agentSkillUpdate.overwriteTitle": "替换已安装的副本?",
+ "agentSkillUpdate.pinned": "已固定到指定提交",
+ "agentSkillUpdate.replace": "替换并更新",
+ "agentSkillUpdate.saved": "技能已与 GitHub 同步",
+ "agentSkillUpdate.track": "跟踪分支",
+ "agentSkillUpdate.unavailable": "暂时无法检查 GitHub",
"agentTab.graph": "Graph 运行时",
"agentTab.opening": "开场设置",
"agentTab.plugin": "技能设置",
diff --git a/packages/database/migrations/0222_agent_skill_upstream.sql b/packages/database/migrations/0222_agent_skill_upstream.sql
new file mode 100644
index 00000000000..0de1c5c3090
--- /dev/null
+++ b/packages/database/migrations/0222_agent_skill_upstream.sql
@@ -0,0 +1 @@
+ALTER TABLE "agent_skills" ADD COLUMN IF NOT EXISTS "upstream" jsonb;
diff --git a/packages/database/migrations/meta/0212_snapshot.json b/packages/database/migrations/meta/0222_snapshot.json
similarity index 89%
rename from packages/database/migrations/meta/0212_snapshot.json
rename to packages/database/migrations/meta/0222_snapshot.json
index 077e1536e00..acca7f2030a 100644
--- a/packages/database/migrations/meta/0212_snapshot.json
+++ b/packages/database/migrations/meta/0222_snapshot.json
@@ -1,8 +1,28 @@
{
- "id": "839a7f65-d033-45df-8b5e-1f80a983f758",
- "prevId": "45b20770-a9d5-4005-9171-07a02f3ec86d",
- "version": "7",
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ },
"dialect": "postgresql",
+ "enums": {},
+ "id": "367a1cd7-ebf2-48db-9e9c-ec804563b475",
+ "policies": {},
+ "prevId": "4caccfb8-4b95-4149-b512-2d72e1ba77de",
+ "roles": {},
+ "schemas": {},
+ "sequences": {
+ "public.fts_search_sync_revision_seq": {
+ "name": "fts_search_sync_revision_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "9223372036854775807",
+ "cache": "1",
+ "cycle": false
+ }
+ },
"tables": {
"public.acceptance_comments": {
"name": "acceptance_comments",
@@ -112,6 +132,12 @@
"primaryKey": false,
"notNull": false
},
+ "review_mark_id": {
+ "name": "review_mark_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
"client_id": {
"name": "client_id",
"type": "text",
@@ -280,6 +306,21 @@
"concurrently": false,
"method": "btree",
"with": {}
+ },
+ "acceptance_comments_review_mark_id_idx": {
+ "name": "acceptance_comments_review_mark_id_idx",
+ "columns": [
+ {
+ "expression": "review_mark_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
}
},
"foreignKeys": {
@@ -287,12 +328,8 @@
"name": "acceptance_comments_acceptance_id_acceptances_id_fk",
"tableFrom": "acceptance_comments",
"tableTo": "acceptances",
- "columnsFrom": [
- "acceptance_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["acceptance_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -300,12 +337,8 @@
"name": "acceptance_comments_author_user_id_users_id_fk",
"tableFrom": "acceptance_comments",
"tableTo": "users",
- "columnsFrom": [
- "author_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["author_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -313,12 +346,8 @@
"name": "acceptance_comments_author_agent_id_agents_id_fk",
"tableFrom": "acceptance_comments",
"tableTo": "agents",
- "columnsFrom": [
- "author_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["author_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -326,12 +355,8 @@
"name": "acceptance_comments_workspace_id_workspaces_id_fk",
"tableFrom": "acceptance_comments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -339,12 +364,8 @@
"name": "acceptance_comments_parent_comment_id_acceptance_comments_id_fk",
"tableFrom": "acceptance_comments",
"tableTo": "acceptance_comments",
- "columnsFrom": [
- "parent_comment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_comment_id"],
+ "columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
},
@@ -352,12 +373,8 @@
"name": "acceptance_comments_context_run_id_verify_runs_id_fk",
"tableFrom": "acceptance_comments",
"tableTo": "verify_runs",
- "columnsFrom": [
- "context_run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["context_run_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -365,25 +382,26 @@
"name": "acceptance_comments_evidence_id_verify_evidence_id_fk",
"tableFrom": "acceptance_comments",
"tableTo": "verify_evidence",
- "columnsFrom": [
- "evidence_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["evidence_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
+ "acceptance_comments_review_mark_id_acceptance_review_marks_id_fk": {
+ "name": "acceptance_comments_review_mark_id_acceptance_review_marks_id_fk",
+ "tableFrom": "acceptance_comments",
+ "tableTo": "acceptance_review_marks",
+ "columnsFrom": ["review_mark_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
"acceptance_comments_resolved_by_user_id_users_id_fk": {
"name": "acceptance_comments_resolved_by_user_id_users_id_fk",
"tableFrom": "acceptance_comments",
"tableTo": "users",
- "columnsFrom": [
- "resolved_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["resolved_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -492,12 +510,8 @@
"name": "acceptance_flow_edges_flow_id_acceptance_flows_id_fk",
"tableFrom": "acceptance_flow_edges",
"tableTo": "acceptance_flows",
- "columnsFrom": [
- "flow_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["flow_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -505,14 +519,8 @@
"name": "acceptance_flow_edges_flow_id_source_node_id_acceptance_flow_nodes_flow_id_id_fk",
"tableFrom": "acceptance_flow_edges",
"tableTo": "acceptance_flow_nodes",
- "columnsFrom": [
- "flow_id",
- "source_node_id"
- ],
- "columnsTo": [
- "flow_id",
- "id"
- ],
+ "columnsFrom": ["flow_id", "source_node_id"],
+ "columnsTo": ["flow_id", "id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -520,14 +528,8 @@
"name": "acceptance_flow_edges_flow_id_target_node_id_acceptance_flow_nodes_flow_id_id_fk",
"tableFrom": "acceptance_flow_edges",
"tableTo": "acceptance_flow_nodes",
- "columnsFrom": [
- "flow_id",
- "target_node_id"
- ],
- "columnsTo": [
- "flow_id",
- "id"
- ],
+ "columnsFrom": ["flow_id", "target_node_id"],
+ "columnsTo": ["flow_id", "id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -655,12 +657,8 @@
"name": "acceptance_flow_nodes_flow_id_acceptance_flows_id_fk",
"tableFrom": "acceptance_flow_nodes",
"tableTo": "acceptance_flows",
- "columnsFrom": [
- "flow_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["flow_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -668,12 +666,8 @@
"name": "acceptance_flow_nodes_criterion_id_verify_criteria_id_fk",
"tableFrom": "acceptance_flow_nodes",
"tableTo": "verify_criteria",
- "columnsFrom": [
- "criterion_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["criterion_id"],
+ "columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
},
@@ -681,12 +675,8 @@
"name": "acceptance_flow_nodes_sub_flow_id_acceptance_flows_id_fk",
"tableFrom": "acceptance_flow_nodes",
"tableTo": "acceptance_flows",
- "columnsFrom": [
- "sub_flow_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["sub_flow_id"],
+ "columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
}
@@ -769,14 +759,454 @@
"name": "acceptance_flows_acceptance_id_acceptances_id_fk",
"tableFrom": "acceptance_flows",
"tableTo": "acceptances",
- "columnsFrom": [
- "acceptance_id"
+ "columnsFrom": ["acceptance_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.acceptance_review_marks": {
+ "name": "acceptance_review_marks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "review_id": {
+ "name": "review_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "seq": {
+ "name": "seq",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "route_key": {
+ "name": "route_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_meta": {
+ "name": "page_meta",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rect_document": {
+ "name": "rect_document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rect_viewport": {
+ "name": "rect_viewport",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "scroll": {
+ "name": "scroll",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "viewport": {
+ "name": "viewport",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "regions": {
+ "name": "regions",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "region_refs": {
+ "name": "region_refs",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "targets": {
+ "name": "targets",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sketch": {
+ "name": "sketch",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "context": {
+ "name": "context",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "screenshot_file_id": {
+ "name": "screenshot_file_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "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": {
+ "acceptance_review_marks_review_id_client_id_unique": {
+ "name": "acceptance_review_marks_review_id_client_id_unique",
+ "columns": [
+ {
+ "expression": "review_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "acceptance_review_marks_review_id_seq_unique": {
+ "name": "acceptance_review_marks_review_id_seq_unique",
+ "columns": [
+ {
+ "expression": "review_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "seq",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "acceptance_review_marks_route_key_review_id_idx": {
+ "name": "acceptance_review_marks_route_key_review_id_idx",
+ "columns": [
+ {
+ "expression": "route_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "review_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "acceptance_review_marks_review_id_acceptance_reviews_id_fk": {
+ "name": "acceptance_review_marks_review_id_acceptance_reviews_id_fk",
+ "tableFrom": "acceptance_review_marks",
+ "tableTo": "acceptance_reviews",
+ "columnsFrom": ["review_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "acceptance_review_marks_screenshot_file_id_files_id_fk": {
+ "name": "acceptance_review_marks_screenshot_file_id_files_id_fk",
+ "tableFrom": "acceptance_review_marks",
+ "tableTo": "files",
+ "columnsFrom": ["screenshot_file_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.acceptance_reviews": {
+ "name": "acceptance_reviews",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'draft'"
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_mark_seq": {
+ "name": "last_mark_seq",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "submitted_at": {
+ "name": "submitted_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": {
+ "acceptance_reviews_site_id_created_at_idx": {
+ "name": "acceptance_reviews_site_id_created_at_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
],
- "columnsTo": [
- "id"
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "acceptance_reviews_task_id_idx": {
+ "name": "acceptance_reviews_task_id_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "acceptance_reviews_user_id_idx": {
+ "name": "acceptance_reviews_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "acceptance_reviews_workspace_id_idx": {
+ "name": "acceptance_reviews_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "acceptance_reviews_one_draft_per_user_unique": {
+ "name": "acceptance_reviews_one_draft_per_user_unique",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"acceptance_reviews\".\"status\" = 'draft'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "acceptance_reviews_site_id_project_sites_id_fk": {
+ "name": "acceptance_reviews_site_id_project_sites_id_fk",
+ "tableFrom": "acceptance_reviews",
+ "tableTo": "project_sites",
+ "columnsFrom": ["site_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "acceptance_reviews_user_id_users_id_fk": {
+ "name": "acceptance_reviews_user_id_users_id_fk",
+ "tableFrom": "acceptance_reviews",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "acceptance_reviews_workspace_id_workspaces_id_fk": {
+ "name": "acceptance_reviews_workspace_id_workspaces_id_fk",
+ "tableFrom": "acceptance_reviews",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
+ },
+ "acceptance_reviews_project_id_projects_id_fk": {
+ "name": "acceptance_reviews_project_id_projects_id_fk",
+ "tableFrom": "acceptance_reviews",
+ "tableTo": "projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "acceptance_reviews_task_id_tasks_id_fk": {
+ "name": "acceptance_reviews_task_id_tasks_id_fk",
+ "tableFrom": "acceptance_reviews",
+ "tableTo": "tasks",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@@ -1203,12 +1633,8 @@
"name": "agents_user_id_users_id_fk",
"tableFrom": "agents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1216,12 +1642,8 @@
"name": "agents_workspace_id_workspaces_id_fk",
"tableFrom": "agents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1229,12 +1651,8 @@
"name": "agents_session_group_id_session_groups_id_fk",
"tableFrom": "agents",
"tableTo": "session_groups",
- "columnsFrom": [
- "session_group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["session_group_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -1369,12 +1787,8 @@
"name": "agents_files_file_id_files_id_fk",
"tableFrom": "agents_files",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1382,12 +1796,8 @@
"name": "agents_files_agent_id_agents_id_fk",
"tableFrom": "agents_files",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1395,12 +1805,8 @@
"name": "agents_files_user_id_users_id_fk",
"tableFrom": "agents_files",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1408,12 +1814,8 @@
"name": "agents_files_workspace_id_workspaces_id_fk",
"tableFrom": "agents_files",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -1421,11 +1823,7 @@
"compositePrimaryKeys": {
"agents_files_file_id_agent_id_user_id_pk": {
"name": "agents_files_file_id_agent_id_user_id_pk",
- "columns": [
- "file_id",
- "agent_id",
- "user_id"
- ]
+ "columns": ["file_id", "agent_id", "user_id"]
}
},
"uniqueConstraints": {},
@@ -1557,12 +1955,8 @@
"name": "agents_knowledge_bases_agent_id_agents_id_fk",
"tableFrom": "agents_knowledge_bases",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1570,12 +1964,8 @@
"name": "agents_knowledge_bases_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "agents_knowledge_bases",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1583,12 +1973,8 @@
"name": "agents_knowledge_bases_user_id_users_id_fk",
"tableFrom": "agents_knowledge_bases",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1596,12 +1982,8 @@
"name": "agents_knowledge_bases_workspace_id_workspaces_id_fk",
"tableFrom": "agents_knowledge_bases",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -1609,10 +1991,7 @@
"compositePrimaryKeys": {
"agents_knowledge_bases_agent_id_knowledge_base_id_pk": {
"name": "agents_knowledge_bases_agent_id_knowledge_base_id_pk",
- "columns": [
- "agent_id",
- "knowledge_base_id"
- ]
+ "columns": ["agent_id", "knowledge_base_id"]
}
},
"uniqueConstraints": {},
@@ -1848,12 +2227,8 @@
"name": "agent_accounts_agent_id_agents_id_fk",
"tableFrom": "agent_accounts",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1861,12 +2236,8 @@
"name": "agent_accounts_user_id_users_id_fk",
"tableFrom": "agent_accounts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1874,12 +2245,8 @@
"name": "agent_accounts_workspace_id_workspaces_id_fk",
"tableFrom": "agent_accounts",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -2061,12 +2428,8 @@
"name": "agent_bot_providers_agent_id_agents_id_fk",
"tableFrom": "agent_bot_providers",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2074,12 +2437,8 @@
"name": "agent_bot_providers_user_id_users_id_fk",
"tableFrom": "agent_bot_providers",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2087,12 +2446,8 @@
"name": "agent_bot_providers_workspace_id_workspaces_id_fk",
"tableFrom": "agent_bot_providers",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -2358,12 +2713,8 @@
"name": "agent_cron_jobs_agent_id_agents_id_fk",
"tableFrom": "agent_cron_jobs",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2371,12 +2722,8 @@
"name": "agent_cron_jobs_group_id_chat_groups_id_fk",
"tableFrom": "agent_cron_jobs",
"tableTo": "chat_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2384,12 +2731,8 @@
"name": "agent_cron_jobs_user_id_users_id_fk",
"tableFrom": "agent_cron_jobs",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2397,12 +2740,8 @@
"name": "agent_cron_jobs_workspace_id_workspaces_id_fk",
"tableFrom": "agent_cron_jobs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -2840,12 +3179,8 @@
"name": "agent_documents_user_id_users_id_fk",
"tableFrom": "agent_documents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2853,12 +3188,8 @@
"name": "agent_documents_workspace_id_workspaces_id_fk",
"tableFrom": "agent_documents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2866,12 +3197,8 @@
"name": "agent_documents_agent_id_agents_id_fk",
"tableFrom": "agent_documents",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2879,12 +3206,8 @@
"name": "agent_documents_document_id_documents_id_fk",
"tableFrom": "agent_documents",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2892,12 +3215,8 @@
"name": "agent_documents_deleted_by_user_id_users_id_fk",
"tableFrom": "agent_documents",
"tableTo": "users",
- "columnsFrom": [
- "deleted_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["deleted_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -2905,12 +3224,8 @@
"name": "agent_documents_deleted_by_agent_id_agents_id_fk",
"tableFrom": "agent_documents",
"tableTo": "agents",
- "columnsFrom": [
- "deleted_by_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["deleted_by_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -3171,12 +3486,8 @@
"name": "agent_eval_memories_user_id_users_id_fk",
"tableFrom": "agent_eval_memories",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3184,12 +3495,8 @@
"name": "agent_eval_memories_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_memories",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3197,12 +3504,8 @@
"name": "agent_eval_memories_run_id_agent_eval_runs_id_fk",
"tableFrom": "agent_eval_memories",
"tableTo": "agent_eval_runs",
- "columnsFrom": [
- "run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["run_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3210,12 +3513,8 @@
"name": "agent_eval_memories_topic_id_topics_id_fk",
"tableFrom": "agent_eval_memories",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -3223,12 +3522,8 @@
"name": "agent_eval_memories_thread_id_threads_id_fk",
"tableFrom": "agent_eval_memories",
"tableTo": "threads",
- "columnsFrom": [
- "thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["thread_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -3422,12 +3717,8 @@
"name": "agent_eval_benchmarks_user_id_users_id_fk",
"tableFrom": "agent_eval_benchmarks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3435,12 +3726,8 @@
"name": "agent_eval_benchmarks_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_benchmarks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -3654,12 +3941,8 @@
"name": "agent_eval_datasets_benchmark_id_agent_eval_benchmarks_id_fk",
"tableFrom": "agent_eval_datasets",
"tableTo": "agent_eval_benchmarks",
- "columnsFrom": [
- "benchmark_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["benchmark_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3667,12 +3950,8 @@
"name": "agent_eval_datasets_source_experiment_id_agent_eval_experiments_id_fk",
"tableFrom": "agent_eval_datasets",
"tableTo": "agent_eval_experiments",
- "columnsFrom": [
- "source_experiment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["source_experiment_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -3680,12 +3959,8 @@
"name": "agent_eval_datasets_user_id_users_id_fk",
"tableFrom": "agent_eval_datasets",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3693,12 +3968,8 @@
"name": "agent_eval_datasets_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_datasets",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -3865,12 +4136,8 @@
"name": "agent_eval_environments_user_id_users_id_fk",
"tableFrom": "agent_eval_environments",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3878,12 +4145,8 @@
"name": "agent_eval_environments_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_environments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -3982,12 +4245,8 @@
"name": "agent_eval_experiment_benchmarks_experiment_id_agent_eval_experiments_id_fk",
"tableFrom": "agent_eval_experiment_benchmarks",
"tableTo": "agent_eval_experiments",
- "columnsFrom": [
- "experiment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["experiment_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3995,12 +4254,8 @@
"name": "agent_eval_experiment_benchmarks_benchmark_id_agent_eval_benchmarks_id_fk",
"tableFrom": "agent_eval_experiment_benchmarks",
"tableTo": "agent_eval_benchmarks",
- "columnsFrom": [
- "benchmark_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["benchmark_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4008,12 +4263,8 @@
"name": "agent_eval_experiment_benchmarks_user_id_users_id_fk",
"tableFrom": "agent_eval_experiment_benchmarks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4021,12 +4272,8 @@
"name": "agent_eval_experiment_benchmarks_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_experiment_benchmarks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -4034,10 +4281,7 @@
"compositePrimaryKeys": {
"agent_eval_experiment_benchmarks_experiment_id_benchmark_id_pk": {
"name": "agent_eval_experiment_benchmarks_experiment_id_benchmark_id_pk",
- "columns": [
- "experiment_id",
- "benchmark_id"
- ]
+ "columns": ["experiment_id", "benchmark_id"]
}
},
"uniqueConstraints": {},
@@ -4144,12 +4388,8 @@
"name": "agent_eval_experiments_user_id_users_id_fk",
"tableFrom": "agent_eval_experiments",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4157,12 +4397,8 @@
"name": "agent_eval_experiments_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_experiments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -4306,12 +4542,8 @@
"name": "agent_eval_run_topics_user_id_users_id_fk",
"tableFrom": "agent_eval_run_topics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4319,12 +4551,8 @@
"name": "agent_eval_run_topics_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_run_topics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4332,12 +4560,8 @@
"name": "agent_eval_run_topics_run_id_agent_eval_runs_id_fk",
"tableFrom": "agent_eval_run_topics",
"tableTo": "agent_eval_runs",
- "columnsFrom": [
- "run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["run_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4345,12 +4569,8 @@
"name": "agent_eval_run_topics_topic_id_topics_id_fk",
"tableFrom": "agent_eval_run_topics",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4358,12 +4578,8 @@
"name": "agent_eval_run_topics_test_case_id_agent_eval_test_cases_id_fk",
"tableFrom": "agent_eval_run_topics",
"tableTo": "agent_eval_test_cases",
- "columnsFrom": [
- "test_case_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["test_case_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -4371,10 +4587,7 @@
"compositePrimaryKeys": {
"agent_eval_run_topics_run_id_topic_id_pk": {
"name": "agent_eval_run_topics_run_id_topic_id_pk",
- "columns": [
- "run_id",
- "topic_id"
- ]
+ "columns": ["run_id", "topic_id"]
}
},
"uniqueConstraints": {},
@@ -4593,12 +4806,8 @@
"name": "agent_eval_runs_dataset_id_agent_eval_datasets_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "agent_eval_datasets",
- "columnsFrom": [
- "dataset_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dataset_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4606,12 +4815,8 @@
"name": "agent_eval_runs_experiment_id_agent_eval_experiments_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "agent_eval_experiments",
- "columnsFrom": [
- "experiment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["experiment_id"],
+ "columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
},
@@ -4619,12 +4824,8 @@
"name": "agent_eval_runs_target_agent_id_agents_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "agents",
- "columnsFrom": [
- "target_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["target_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4632,12 +4833,8 @@
"name": "agent_eval_runs_user_id_users_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4645,12 +4842,8 @@
"name": "agent_eval_runs_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4658,12 +4851,8 @@
"name": "agent_eval_runs_parent_run_id_agent_eval_runs_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "agent_eval_runs",
- "columnsFrom": [
- "parent_run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_run_id"],
+ "columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
}
@@ -4842,12 +5031,8 @@
"name": "agent_eval_test_cases_user_id_users_id_fk",
"tableFrom": "agent_eval_test_cases",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4855,12 +5040,8 @@
"name": "agent_eval_test_cases_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_test_cases",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4868,12 +5049,8 @@
"name": "agent_eval_test_cases_dataset_id_agent_eval_datasets_id_fk",
"tableFrom": "agent_eval_test_cases",
"tableTo": "agent_eval_datasets",
- "columnsFrom": [
- "dataset_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dataset_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4881,12 +5058,8 @@
"name": "agent_eval_test_cases_environment_id_agent_eval_environments_id_fk",
"tableFrom": "agent_eval_test_cases",
"tableTo": "agent_eval_environments",
- "columnsFrom": [
- "environment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["environment_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -4964,12 +5137,8 @@
"name": "agent_history_job_agents_job_id_agent_history_jobs_id_fk",
"tableFrom": "agent_history_job_agents",
"tableTo": "agent_history_jobs",
- "columnsFrom": [
- "job_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["job_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4977,12 +5146,8 @@
"name": "agent_history_job_agents_agent_id_agents_id_fk",
"tableFrom": "agent_history_job_agents",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -5060,12 +5225,8 @@
"name": "agent_history_job_groups_job_id_agent_history_jobs_id_fk",
"tableFrom": "agent_history_job_groups",
"tableTo": "agent_history_jobs",
- "columnsFrom": [
- "job_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["job_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5073,12 +5234,8 @@
"name": "agent_history_job_groups_group_id_chat_groups_id_fk",
"tableFrom": "agent_history_job_groups",
"tableTo": "chat_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -5202,12 +5359,8 @@
"name": "agent_history_job_topics_job_id_agent_history_jobs_id_fk",
"tableFrom": "agent_history_job_topics",
"tableTo": "agent_history_jobs",
- "columnsFrom": [
- "job_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["job_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5215,12 +5368,8 @@
"name": "agent_history_job_topics_topic_id_topics_id_fk",
"tableFrom": "agent_history_job_topics",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -5722,12 +5871,8 @@
"name": "agent_inbox_messages_agent_id_agents_id_fk",
"tableFrom": "agent_inbox_messages",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5735,12 +5880,8 @@
"name": "agent_inbox_messages_user_id_users_id_fk",
"tableFrom": "agent_inbox_messages",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5748,12 +5889,8 @@
"name": "agent_inbox_messages_workspace_id_workspaces_id_fk",
"tableFrom": "agent_inbox_messages",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5761,12 +5898,8 @@
"name": "agent_inbox_messages_account_id_agent_accounts_id_fk",
"tableFrom": "agent_inbox_messages",
"tableTo": "agent_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5774,12 +5907,8 @@
"name": "agent_inbox_messages_topic_id_topics_id_fk",
"tableFrom": "agent_inbox_messages",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -6093,12 +6222,8 @@
"name": "agent_intervention_resolutions_operation_id_agent_operations_id_fk",
"tableFrom": "agent_intervention_resolutions",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6106,12 +6231,8 @@
"name": "agent_intervention_resolutions_user_id_users_id_fk",
"tableFrom": "agent_intervention_resolutions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6119,12 +6240,8 @@
"name": "agent_intervention_resolutions_workspace_id_workspaces_id_fk",
"tableFrom": "agent_intervention_resolutions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -6588,12 +6705,8 @@
"name": "agent_interventions_operation_id_agent_operations_id_fk",
"tableFrom": "agent_interventions",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6601,12 +6714,8 @@
"name": "agent_interventions_user_id_users_id_fk",
"tableFrom": "agent_interventions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6614,12 +6723,8 @@
"name": "agent_interventions_workspace_id_workspaces_id_fk",
"tableFrom": "agent_interventions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6627,12 +6732,8 @@
"name": "agent_interventions_resolution_id_agent_intervention_resolutions_id_fk",
"tableFrom": "agent_interventions",
"tableTo": "agent_intervention_resolutions",
- "columnsFrom": [
- "resolution_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["resolution_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -6794,12 +6895,8 @@
"name": "agent_label_assignments_label_id_agent_labels_id_fk",
"tableFrom": "agent_label_assignments",
"tableTo": "agent_labels",
- "columnsFrom": [
- "label_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["label_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6807,12 +6904,8 @@
"name": "agent_label_assignments_agent_id_agents_id_fk",
"tableFrom": "agent_label_assignments",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6820,12 +6913,8 @@
"name": "agent_label_assignments_user_id_users_id_fk",
"tableFrom": "agent_label_assignments",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6833,12 +6922,8 @@
"name": "agent_label_assignments_workspace_id_workspaces_id_fk",
"tableFrom": "agent_label_assignments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -7000,12 +7085,8 @@
"name": "agent_labels_user_id_users_id_fk",
"tableFrom": "agent_labels",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7013,12 +7094,8 @@
"name": "agent_labels_workspace_id_workspaces_id_fk",
"tableFrom": "agent_labels",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -7301,12 +7378,8 @@
"name": "agent_mails_agent_id_agents_id_fk",
"tableFrom": "agent_mails",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7314,12 +7387,8 @@
"name": "agent_mails_user_id_users_id_fk",
"tableFrom": "agent_mails",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7327,12 +7396,8 @@
"name": "agent_mails_workspace_id_workspaces_id_fk",
"tableFrom": "agent_mails",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7340,12 +7405,8 @@
"name": "agent_mails_account_id_agent_accounts_id_fk",
"tableFrom": "agent_mails",
"tableTo": "agent_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7353,12 +7414,8 @@
"name": "agent_mails_signal_id_signals_id_fk",
"tableFrom": "agent_mails",
"tableTo": "signals",
- "columnsFrom": [
- "signal_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["signal_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -7842,12 +7899,8 @@
"name": "agent_operations_workspace_id_workspaces_id_fk",
"tableFrom": "agent_operations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7855,12 +7908,8 @@
"name": "agent_operations_agent_id_agents_id_fk",
"tableFrom": "agent_operations",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -7868,12 +7917,8 @@
"name": "agent_operations_topic_id_topics_id_fk",
"tableFrom": "agent_operations",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -7881,12 +7926,8 @@
"name": "agent_operations_thread_id_threads_id_fk",
"tableFrom": "agent_operations",
"tableTo": "threads",
- "columnsFrom": [
- "thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["thread_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -7894,12 +7935,8 @@
"name": "agent_operations_task_id_tasks_id_fk",
"tableFrom": "agent_operations",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -7907,12 +7944,8 @@
"name": "agent_operations_chat_group_id_chat_groups_id_fk",
"tableFrom": "agent_operations",
"tableTo": "chat_groups",
- "columnsFrom": [
- "chat_group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chat_group_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -8112,12 +8145,8 @@
"name": "agent_account_bindings_agent_id_agents_id_fk",
"tableFrom": "agent_account_bindings",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8125,12 +8154,8 @@
"name": "agent_account_bindings_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_account_bindings",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8138,12 +8163,8 @@
"name": "agent_account_bindings_user_id_users_id_fk",
"tableFrom": "agent_account_bindings",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8151,12 +8172,8 @@
"name": "agent_account_bindings_workspace_id_workspaces_id_fk",
"tableFrom": "agent_account_bindings",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -8324,12 +8341,8 @@
"name": "agent_device_account_bindings_agent_id_agents_id_fk",
"tableFrom": "agent_device_account_bindings",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8337,12 +8350,8 @@
"name": "agent_device_account_bindings_user_id_users_id_fk",
"tableFrom": "agent_device_account_bindings",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8350,12 +8359,8 @@
"name": "agent_device_account_bindings_workspace_id_workspaces_id_fk",
"tableFrom": "agent_device_account_bindings",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8363,12 +8368,8 @@
"name": "agent_device_account_bindings_device_id_devices_id_fk",
"tableFrom": "agent_device_account_bindings",
"tableTo": "devices",
- "columnsFrom": [
- "device_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8376,12 +8377,8 @@
"name": "agent_device_account_bindings_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_device_account_bindings",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8389,14 +8386,8 @@
"name": "agent_device_account_bindings_login_fk",
"tableFrom": "agent_device_account_bindings",
"tableTo": "agent_provider_account_logins",
- "columnsFrom": [
- "account_id",
- "device_id"
- ],
- "columnsTo": [
- "account_id",
- "device_id"
- ],
+ "columnsFrom": ["account_id", "device_id"],
+ "columnsTo": ["account_id", "device_id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -8530,12 +8521,8 @@
"name": "agent_provider_account_logins_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_provider_account_logins",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8543,12 +8530,8 @@
"name": "agent_provider_account_logins_device_id_devices_id_fk",
"tableFrom": "agent_provider_account_logins",
"tableTo": "devices",
- "columnsFrom": [
- "device_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8556,12 +8539,8 @@
"name": "agent_provider_account_logins_user_id_users_id_fk",
"tableFrom": "agent_provider_account_logins",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8569,12 +8548,8 @@
"name": "agent_provider_account_logins_workspace_id_workspaces_id_fk",
"tableFrom": "agent_provider_account_logins",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -8584,10 +8559,7 @@
"agent_provider_account_logins_account_device_unique": {
"name": "agent_provider_account_logins_account_device_unique",
"nullsNotDistinct": false,
- "columns": [
- "account_id",
- "device_id"
- ]
+ "columns": ["account_id", "device_id"]
}
},
"policies": {},
@@ -8880,12 +8852,8 @@
"name": "agent_provider_accounts_user_id_users_id_fk",
"tableFrom": "agent_provider_accounts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8893,12 +8861,8 @@
"name": "agent_provider_accounts_workspace_id_workspaces_id_fk",
"tableFrom": "agent_provider_accounts",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -9084,12 +9048,8 @@
"name": "agent_quota_calibrations_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_quota_calibrations",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9097,12 +9057,8 @@
"name": "agent_quota_calibrations_user_id_users_id_fk",
"tableFrom": "agent_quota_calibrations",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9110,12 +9066,8 @@
"name": "agent_quota_calibrations_workspace_id_workspaces_id_fk",
"tableFrom": "agent_quota_calibrations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -9325,12 +9277,8 @@
"name": "agent_quota_snapshots_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_quota_snapshots",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9338,12 +9286,8 @@
"name": "agent_quota_snapshots_user_id_users_id_fk",
"tableFrom": "agent_quota_snapshots",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9351,12 +9295,8 @@
"name": "agent_quota_snapshots_workspace_id_workspaces_id_fk",
"tableFrom": "agent_quota_snapshots",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9364,12 +9304,8 @@
"name": "agent_quota_snapshots_device_id_devices_id_fk",
"tableFrom": "agent_quota_snapshots",
"tableTo": "devices",
- "columnsFrom": [
- "device_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -9644,12 +9580,8 @@
"name": "agent_quota_usage_ledger_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -9657,12 +9589,8 @@
"name": "agent_quota_usage_ledger_user_id_users_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9670,12 +9598,8 @@
"name": "agent_quota_usage_ledger_workspace_id_workspaces_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9683,12 +9607,8 @@
"name": "agent_quota_usage_ledger_message_id_messages_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -9696,12 +9616,8 @@
"name": "agent_quota_usage_ledger_operation_id_agent_operations_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -9709,12 +9625,8 @@
"name": "agent_quota_usage_ledger_topic_id_topics_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -9722,12 +9634,8 @@
"name": "agent_quota_usage_ledger_agent_id_agents_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -9967,12 +9875,8 @@
"name": "agent_quota_windows_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_quota_windows",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9980,12 +9884,8 @@
"name": "agent_quota_windows_user_id_users_id_fk",
"tableFrom": "agent_quota_windows",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9993,12 +9893,8 @@
"name": "agent_quota_windows_workspace_id_workspaces_id_fk",
"tableFrom": "agent_quota_windows",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -10105,12 +10001,8 @@
"name": "agent_shares_agent_id_agents_id_fk",
"tableFrom": "agent_shares",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -10155,6 +10047,12 @@
"primaryKey": false,
"notNull": true
},
+ "upstream": {
+ "name": "upstream",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
"manifest": {
"name": "manifest",
"type": "jsonb",
@@ -10359,12 +10257,8 @@
"name": "agent_skills_zip_file_hash_global_files_hash_id_fk",
"tableFrom": "agent_skills",
"tableTo": "global_files",
- "columnsFrom": [
- "zip_file_hash"
- ],
- "columnsTo": [
- "hash_id"
- ],
+ "columnsFrom": ["zip_file_hash"],
+ "columnsTo": ["hash_id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -10372,12 +10266,8 @@
"name": "agent_skills_user_id_users_id_fk",
"tableFrom": "agent_skills",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -10385,12 +10275,8 @@
"name": "agent_skills_workspace_id_workspaces_id_fk",
"tableFrom": "agent_skills",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -10645,12 +10531,8 @@
"name": "ai_models_user_id_users_id_fk",
"tableFrom": "ai_models",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -10658,12 +10540,8 @@
"name": "ai_models_workspace_id_workspaces_id_fk",
"tableFrom": "ai_models",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -10878,12 +10756,8 @@
"name": "ai_providers_user_id_users_id_fk",
"tableFrom": "ai_providers",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -10891,12 +10765,8 @@
"name": "ai_providers_workspace_id_workspaces_id_fk",
"tableFrom": "ai_providers",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -11031,12 +10901,8 @@
"name": "api_keys_user_id_users_id_fk",
"tableFrom": "api_keys",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11044,12 +10910,8 @@
"name": "api_keys_workspace_id_workspaces_id_fk",
"tableFrom": "api_keys",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -11059,24 +10921,20 @@
"api_keys_key_unique": {
"name": "api_keys_key_unique",
"nullsNotDistinct": false,
- "columns": [
- "key"
- ]
+ "columns": ["key"]
},
"api_keys_key_hash_unique": {
"name": "api_keys_key_hash_unique",
"nullsNotDistinct": false,
- "columns": [
- "key_hash"
- ]
+ "columns": ["key_hash"]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.async_tasks": {
- "name": "async_tasks",
+ "public.artboard_boards": {
+ "name": "artboard_boards",
"schema": "",
"columns": {
"id": {
@@ -11086,26 +10944,402 @@
"notNull": true,
"default": "gen_random_uuid()"
},
+ "artboard_id": {
+ "name": "artboard_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_id": {
+ "name": "page_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "group_id": {
+ "name": "group_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "round_id": {
+ "name": "round_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "acceptance_flow_node_id": {
+ "name": "acceptance_flow_node_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
"notNull": false
},
- "status": {
- "name": "status",
+ "expected": {
+ "name": "expected",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "error": {
- "name": "error",
+ "rect": {
+ "name": "rect",
"type": "jsonb",
"primaryKey": false,
+ "notNull": true
+ },
+ "source_work_version_id": {
+ "name": "source_work_version_id",
+ "type": "uuid",
+ "primaryKey": false,
"notNull": false
},
- "inference_id": {
- "name": "inference_id",
+ "source_path": {
+ "name": "source_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_file_id": {
+ "name": "source_file_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "artboard_boards_artboard_id_idx": {
+ "name": "artboard_boards_artboard_id_idx",
+ "columns": [
+ {
+ "expression": "artboard_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_boards_page_id_idx": {
+ "name": "artboard_boards_page_id_idx",
+ "columns": [
+ {
+ "expression": "page_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_boards_group_id_idx": {
+ "name": "artboard_boards_group_id_idx",
+ "columns": [
+ {
+ "expression": "group_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"artboard_boards\".\"group_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_boards_round_id_idx": {
+ "name": "artboard_boards_round_id_idx",
+ "columns": [
+ {
+ "expression": "round_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"artboard_boards\".\"round_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_boards_project_id_idx": {
+ "name": "artboard_boards_project_id_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"artboard_boards\".\"project_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_boards_acceptance_flow_node_id_unique": {
+ "name": "artboard_boards_acceptance_flow_node_id_unique",
+ "columns": [
+ {
+ "expression": "acceptance_flow_node_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"artboard_boards\".\"acceptance_flow_node_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_boards_source_work_version_id_idx": {
+ "name": "artboard_boards_source_work_version_id_idx",
+ "columns": [
+ {
+ "expression": "source_work_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"artboard_boards\".\"source_work_version_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_boards_user_id_idx": {
+ "name": "artboard_boards_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_boards_workspace_id_idx": {
+ "name": "artboard_boards_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"artboard_boards\".\"workspace_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "artboard_boards_artboard_id_artboards_id_fk": {
+ "name": "artboard_boards_artboard_id_artboards_id_fk",
+ "tableFrom": "artboard_boards",
+ "tableTo": "artboards",
+ "columnsFrom": ["artboard_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_boards_page_id_artboard_pages_id_fk": {
+ "name": "artboard_boards_page_id_artboard_pages_id_fk",
+ "tableFrom": "artboard_boards",
+ "tableTo": "artboard_pages",
+ "columnsFrom": ["page_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "artboard_boards_group_id_artboard_groups_id_fk": {
+ "name": "artboard_boards_group_id_artboard_groups_id_fk",
+ "tableFrom": "artboard_boards",
+ "tableTo": "artboard_groups",
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "artboard_boards_round_id_artboard_rounds_id_fk": {
+ "name": "artboard_boards_round_id_artboard_rounds_id_fk",
+ "tableFrom": "artboard_boards",
+ "tableTo": "artboard_rounds",
+ "columnsFrom": ["round_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "artboard_boards_user_id_users_id_fk": {
+ "name": "artboard_boards_user_id_users_id_fk",
+ "tableFrom": "artboard_boards",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_boards_workspace_id_workspaces_id_fk": {
+ "name": "artboard_boards_workspace_id_workspaces_id_fk",
+ "tableFrom": "artboard_boards",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_boards_project_id_projects_id_fk": {
+ "name": "artboard_boards_project_id_projects_id_fk",
+ "tableFrom": "artboard_boards",
+ "tableTo": "projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "artboard_boards_source_work_version_id_work_versions_id_fk": {
+ "name": "artboard_boards_source_work_version_id_work_versions_id_fk",
+ "tableFrom": "artboard_boards",
+ "tableTo": "work_versions",
+ "columnsFrom": ["source_work_version_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "artboard_boards_source_file_id_files_id_fk": {
+ "name": "artboard_boards_source_file_id_files_id_fk",
+ "tableFrom": "artboard_boards",
+ "tableTo": "files",
+ "columnsFrom": ["source_file_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "artboard_boards_single_source_check": {
+ "name": "artboard_boards_single_source_check",
+ "value": "num_nonnulls(\"artboard_boards\".\"source_work_version_id\", \"artboard_boards\".\"source_file_id\") <= 1"
+ },
+ "artboard_boards_decision_no_source_check": {
+ "name": "artboard_boards_decision_no_source_check",
+ "value": "\"artboard_boards\".\"type\" <> 'decision' OR num_nonnulls(\"artboard_boards\".\"source_work_version_id\", \"artboard_boards\".\"source_file_id\", \"artboard_boards\".\"source_path\") = 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.artboard_comments": {
+ "name": "artboard_comments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "artboard_id": {
+ "name": "artboard_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_comment_id": {
+ "name": "parent_comment_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "author_user_id": {
+ "name": "author_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "author_agent_id": {
+ "name": "author_agent_id",
"type": "text",
"primaryKey": false,
"notNull": false
@@ -11122,24 +11356,65 @@
"primaryKey": false,
"notNull": false
},
- "duration": {
- "name": "duration",
- "type": "integer",
+ "page_id": {
+ "name": "page_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "parent_id": {
- "name": "parent_id",
+ "group_id": {
+ "name": "group_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "board_id": {
+ "name": "board_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "anchor": {
+ "name": "anchor",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivered_at": {
+ "name": "delivered_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resolved_by_user_id": {
+ "name": "resolved_by_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
"metadata": {
"name": "metadata",
"type": "jsonb",
"primaryKey": false,
- "notNull": true,
- "default": "'{}'"
+ "notNull": false
},
"accessed_at": {
"name": "accessed_at",
@@ -11164,11 +11439,44 @@
}
},
"indexes": {
- "async_tasks_user_id_idx": {
- "name": "async_tasks_user_id_idx",
+ "artboard_comments_artboard_id_author_user_id_client_id_unique": {
+ "name": "artboard_comments_artboard_id_author_user_id_client_id_unique",
"columns": [
{
- "expression": "user_id",
+ "expression": "artboard_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "author_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "client_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_comments_artboard_id_created_at_idx": {
+ "name": "artboard_comments_artboard_id_created_at_idx",
+ "columns": [
+ {
+ "expression": "artboard_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -11179,11 +11487,11 @@
"method": "btree",
"with": {}
},
- "async_tasks_parent_id_idx": {
- "name": "async_tasks_parent_id_idx",
+ "artboard_comments_parent_comment_id_idx": {
+ "name": "artboard_comments_parent_comment_id_idx",
"columns": [
{
- "expression": "parent_id",
+ "expression": "parent_comment_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -11194,17 +11502,26 @@
"method": "btree",
"with": {}
},
- "async_tasks_type_status_idx": {
- "name": "async_tasks_type_status_idx",
+ "artboard_comments_board_id_idx": {
+ "name": "artboard_comments_board_id_idx",
"columns": [
{
- "expression": "type",
+ "expression": "board_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_comments_user_id_idx": {
+ "name": "artboard_comments_user_id_idx",
+ "columns": [
{
- "expression": "status",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -11215,26 +11532,27 @@
"method": "btree",
"with": {}
},
- "async_tasks_inference_id_idx": {
- "name": "async_tasks_inference_id_idx",
+ "artboard_comments_workspace_id_idx": {
+ "name": "artboard_comments_workspace_id_idx",
"columns": [
{
- "expression": "inference_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"artboard_comments\".\"workspace_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "async_tasks_metadata_idx": {
- "name": "async_tasks_metadata_idx",
+ "artboard_comments_page_id_idx": {
+ "name": "artboard_comments_page_id_idx",
"columns": [
{
- "expression": "metadata",
+ "expression": "page_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -11242,51 +11560,116 @@
],
"isUnique": false,
"concurrently": false,
- "method": "gin",
+ "method": "btree",
"with": {}
},
- "async_tasks_workspace_id_idx": {
- "name": "async_tasks_workspace_id_idx",
+ "artboard_comments_group_id_idx": {
+ "name": "artboard_comments_group_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "group_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"artboard_comments\".\"group_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "async_tasks_user_id_users_id_fk": {
- "name": "async_tasks_user_id_users_id_fk",
- "tableFrom": "async_tasks",
+ "artboard_comments_artboard_id_artboards_id_fk": {
+ "name": "artboard_comments_artboard_id_artboards_id_fk",
+ "tableFrom": "artboard_comments",
+ "tableTo": "artboards",
+ "columnsFrom": ["artboard_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_comments_parent_comment_id_artboard_comments_id_fk": {
+ "name": "artboard_comments_parent_comment_id_artboard_comments_id_fk",
+ "tableFrom": "artboard_comments",
+ "tableTo": "artboard_comments",
+ "columnsFrom": ["parent_comment_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_comments_author_user_id_users_id_fk": {
+ "name": "artboard_comments_author_user_id_users_id_fk",
+ "tableFrom": "artboard_comments",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["author_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "artboard_comments_author_agent_id_agents_id_fk": {
+ "name": "artboard_comments_author_agent_id_agents_id_fk",
+ "tableFrom": "artboard_comments",
+ "tableTo": "agents",
+ "columnsFrom": ["author_agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "artboard_comments_user_id_users_id_fk": {
+ "name": "artboard_comments_user_id_users_id_fk",
+ "tableFrom": "artboard_comments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "async_tasks_workspace_id_workspaces_id_fk": {
- "name": "async_tasks_workspace_id_workspaces_id_fk",
- "tableFrom": "async_tasks",
+ "artboard_comments_workspace_id_workspaces_id_fk": {
+ "name": "artboard_comments_workspace_id_workspaces_id_fk",
+ "tableFrom": "artboard_comments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
+ },
+ "artboard_comments_page_id_artboard_pages_id_fk": {
+ "name": "artboard_comments_page_id_artboard_pages_id_fk",
+ "tableFrom": "artboard_comments",
+ "tableTo": "artboard_pages",
+ "columnsFrom": ["page_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "artboard_comments_group_id_artboard_groups_id_fk": {
+ "name": "artboard_comments_group_id_artboard_groups_id_fk",
+ "tableFrom": "artboard_comments",
+ "tableTo": "artboard_groups",
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "artboard_comments_board_id_artboard_boards_id_fk": {
+ "name": "artboard_comments_board_id_artboard_boards_id_fk",
+ "tableFrom": "artboard_comments",
+ "tableTo": "artboard_boards",
+ "columnsFrom": ["board_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "artboard_comments_resolved_by_user_id_users_id_fk": {
+ "name": "artboard_comments_resolved_by_user_id_users_id_fk",
+ "tableFrom": "artboard_comments",
+ "tableTo": "users",
+ "columnsFrom": ["resolved_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@@ -11295,93 +11678,188 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.accounts": {
- "name": "accounts",
+ "public.artboard_edges": {
+ "name": "artboard_edges",
"schema": "",
"columns": {
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "timestamp",
+ "artboard_id": {
+ "name": "artboard_id",
+ "type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "account_id": {
- "name": "account_id",
- "type": "text",
+ "source_board_id": {
+ "name": "source_board_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp",
+ "target_board_id": {
+ "name": "target_board_id",
+ "type": "uuid",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": true
},
- "id": {
- "name": "id",
+ "user_id": {
+ "name": "user_id",
"type": "text",
- "primaryKey": true,
+ "primaryKey": false,
"notNull": true
},
- "id_token": {
- "name": "id_token",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "password": {
- "name": "password",
- "type": "text",
+ "acceptance_flow_edge_id": {
+ "name": "acceptance_flow_edge_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": false
},
- "provider_id": {
- "name": "provider_id",
+ "label": {
+ "name": "label",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "''"
},
- "refresh_token": {
- "name": "refresh_token",
+ "condition": {
+ "name": "condition",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "timestamp",
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": false
},
- "scope": {
- "name": "scope",
- "type": "text",
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp",
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "now()"
},
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "account_userId_idx": {
- "name": "account_userId_idx",
+ "artboard_edges_artboard_id_idx": {
+ "name": "artboard_edges_artboard_id_idx",
+ "columns": [
+ {
+ "expression": "artboard_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_edges_source_board_id_idx": {
+ "name": "artboard_edges_source_board_id_idx",
+ "columns": [
+ {
+ "expression": "source_board_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_edges_source_board_id_default_unique": {
+ "name": "artboard_edges_source_board_id_default_unique",
+ "columns": [
+ {
+ "expression": "source_board_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"artboard_edges\".\"is_default\" = true",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_edges_target_board_id_idx": {
+ "name": "artboard_edges_target_board_id_idx",
+ "columns": [
+ {
+ "expression": "target_board_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_edges_acceptance_flow_edge_id_unique": {
+ "name": "artboard_edges_acceptance_flow_edge_id_unique",
+ "columns": [
+ {
+ "expression": "acceptance_flow_edge_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"artboard_edges\".\"acceptance_flow_edge_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_edges_user_id_idx": {
+ "name": "artboard_edges_user_id_idx",
"columns": [
{
"expression": "user_id",
@@ -11394,19 +11872,67 @@
"concurrently": false,
"method": "btree",
"with": {}
+ },
+ "artboard_edges_workspace_id_idx": {
+ "name": "artboard_edges_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"artboard_edges\".\"workspace_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
}
},
"foreignKeys": {
- "accounts_user_id_users_id_fk": {
- "name": "accounts_user_id_users_id_fk",
- "tableFrom": "accounts",
+ "artboard_edges_artboard_id_artboards_id_fk": {
+ "name": "artboard_edges_artboard_id_artboards_id_fk",
+ "tableFrom": "artboard_edges",
+ "tableTo": "artboards",
+ "columnsFrom": ["artboard_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_edges_source_board_id_artboard_boards_id_fk": {
+ "name": "artboard_edges_source_board_id_artboard_boards_id_fk",
+ "tableFrom": "artboard_edges",
+ "tableTo": "artboard_boards",
+ "columnsFrom": ["source_board_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_edges_target_board_id_artboard_boards_id_fk": {
+ "name": "artboard_edges_target_board_id_artboard_boards_id_fk",
+ "tableFrom": "artboard_edges",
+ "tableTo": "artboard_boards",
+ "columnsFrom": ["target_board_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_edges_user_id_users_id_fk": {
+ "name": "artboard_edges_user_id_users_id_fk",
+ "tableFrom": "artboard_edges",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_edges_workspace_id_workspaces_id_fk": {
+ "name": "artboard_edges_workspace_id_workspaces_id_fk",
+ "tableFrom": "artboard_edges",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -11417,121 +11943,189 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.passkey": {
- "name": "passkey",
+ "public.artboard_groups": {
+ "name": "artboard_groups",
"schema": "",
"columns": {
- "aaguid": {
- "name": "aaguid",
+ "id": {
+ "name": "id",
"type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "backedUp": {
- "name": "backedUp",
- "type": "boolean",
- "primaryKey": false,
- "notNull": false
+ "primaryKey": true,
+ "notNull": true
},
- "counter": {
- "name": "counter",
- "type": "integer",
+ "artboard_id": {
+ "name": "artboard_id",
+ "type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "createdAt": {
- "name": "createdAt",
- "type": "timestamp",
+ "page_id": {
+ "name": "page_id",
+ "type": "text",
"primaryKey": false,
- "notNull": false,
- "default": "now()"
+ "notNull": true
},
- "credentialID": {
- "name": "credentialID",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "deviceType": {
- "name": "deviceType",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "id": {
- "name": "id",
+ "kind": {
+ "name": "kind",
"type": "text",
- "primaryKey": true,
+ "primaryKey": false,
"notNull": true
},
- "name": {
- "name": "name",
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "publicKey": {
- "name": "publicKey",
+ "description": {
+ "name": "description",
"type": "text",
"primaryKey": false,
+ "notNull": false
+ },
+ "rect": {
+ "name": "rect",
+ "type": "jsonb",
+ "primaryKey": false,
"notNull": true
},
- "transports": {
- "name": "transports",
- "type": "text",
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "userId": {
- "name": "userId",
- "type": "text",
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "passkey_credential_id_unique": {
- "name": "passkey_credential_id_unique",
+ "artboard_groups_artboard_id_idx": {
+ "name": "artboard_groups_artboard_id_idx",
"columns": [
{
- "expression": "credentialID",
+ "expression": "artboard_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "passkey_user_id_idx": {
- "name": "passkey_user_id_idx",
+ "artboard_groups_page_id_idx": {
+ "name": "artboard_groups_page_id_idx",
"columns": [
{
- "expression": "userId",
+ "expression": "page_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_groups_user_id_idx": {
+ "name": "artboard_groups_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_groups_workspace_id_idx": {
+ "name": "artboard_groups_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"artboard_groups\".\"workspace_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "passkey_userId_users_id_fk": {
- "name": "passkey_userId_users_id_fk",
- "tableFrom": "passkey",
+ "artboard_groups_artboard_id_artboards_id_fk": {
+ "name": "artboard_groups_artboard_id_artboards_id_fk",
+ "tableFrom": "artboard_groups",
+ "tableTo": "artboards",
+ "columnsFrom": ["artboard_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_groups_page_id_artboard_pages_id_fk": {
+ "name": "artboard_groups_page_id_artboard_pages_id_fk",
+ "tableFrom": "artboard_groups",
+ "tableTo": "artboard_pages",
+ "columnsFrom": ["page_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "artboard_groups_user_id_users_id_fk": {
+ "name": "artboard_groups_user_id_users_id_fk",
+ "tableFrom": "artboard_groups",
"tableTo": "users",
- "columnsFrom": [
- "userId"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_groups_workspace_id_workspaces_id_fk": {
+ "name": "artboard_groups_workspace_id_workspaces_id_fk",
+ "tableFrom": "artboard_groups",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -11542,72 +12136,81 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.auth_sessions": {
- "name": "auth_sessions",
+ "public.artboard_pages": {
+ "name": "artboard_pages",
"schema": "",
"columns": {
- "created_at": {
- "name": "created_at",
- "type": "timestamp",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
- },
- "expires_at": {
- "name": "expires_at",
- "type": "timestamp",
- "primaryKey": false,
- "notNull": true
- },
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
- "impersonated_by": {
- "name": "impersonated_by",
+ "artboard_id": {
+ "name": "artboard_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "ip_address": {
- "name": "ip_address",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "token": {
- "name": "token",
+ "name": {
+ "name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp",
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": 0
},
- "user_agent": {
- "name": "user_agent",
- "type": "text",
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "auth_session_userId_idx": {
- "name": "auth_session_userId_idx",
+ "artboard_pages_artboard_id_idx": {
+ "name": "artboard_pages_artboard_id_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "artboard_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -11617,72 +12220,12 @@
"concurrently": false,
"method": "btree",
"with": {}
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {
- "auth_sessions_token_unique": {
- "name": "auth_sessions_token_unique",
- "nullsNotDistinct": false,
- "columns": [
- "token"
- ]
- }
- },
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.two_factor": {
- "name": "two_factor",
- "schema": "",
- "columns": {
- "backup_codes": {
- "name": "backup_codes",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": true
},
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- }
- },
- "indexes": {
- "two_factor_secret_idx": {
- "name": "two_factor_secret_idx",
+ "artboard_pages_user_id_idx": {
+ "name": "artboard_pages_user_id_idx",
"columns": [
{
- "expression": "secret",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -11693,33 +12236,48 @@
"method": "btree",
"with": {}
},
- "two_factor_user_id_idx": {
- "name": "two_factor_user_id_idx",
+ "artboard_pages_workspace_id_idx": {
+ "name": "artboard_pages_workspace_id_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"artboard_pages\".\"workspace_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "two_factor_user_id_users_id_fk": {
- "name": "two_factor_user_id_users_id_fk",
- "tableFrom": "two_factor",
+ "artboard_pages_artboard_id_artboards_id_fk": {
+ "name": "artboard_pages_artboard_id_artboards_id_fk",
+ "tableFrom": "artboard_pages",
+ "tableTo": "artboards",
+ "columnsFrom": ["artboard_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_pages_user_id_users_id_fk": {
+ "name": "artboard_pages_user_id_users_id_fk",
+ "tableFrom": "artboard_pages",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_pages_workspace_id_workspaces_id_fk": {
+ "name": "artboard_pages_workspace_id_workspaces_id_fk",
+ "tableFrom": "artboard_pages",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -11730,108 +12288,90 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.verifications": {
- "name": "verifications",
+ "public.artboard_rounds": {
+ "name": "artboard_rounds",
"schema": "",
"columns": {
- "created_at": {
- "name": "created_at",
- "type": "timestamp",
- "primaryKey": false,
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
"notNull": true,
- "default": "now()"
+ "default": "gen_random_uuid()"
},
- "expires_at": {
- "name": "expires_at",
- "type": "timestamp",
+ "artboard_id": {
+ "name": "artboard_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "id": {
- "name": "id",
+ "page_id": {
+ "name": "page_id",
"type": "text",
- "primaryKey": true,
+ "primaryKey": false,
"notNull": true
},
- "identifier": {
- "name": "identifier",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp",
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
},
- "value": {
- "name": "value",
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
- }
- },
- "indexes": {
- "verification_identifier_idx": {
- "name": "verification_identifier_idx",
- "columns": [
- {
- "expression": "identifier",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.channel_audit": {
- "name": "channel_audit",
- "schema": "",
- "columns": {
- "id": {
- "name": "id",
- "type": "uuid",
- "primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
},
- "channel_id": {
- "name": "channel_id",
+ "status": {
+ "name": "status",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "'open'"
},
- "event": {
- "name": "event",
- "type": "text",
+ "recommended_board_id": {
+ "name": "recommended_board_id",
+ "type": "uuid",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "target_id": {
- "name": "target_id",
+ "chosen_board_id": {
+ "name": "chosen_board_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "selected_by": {
+ "name": "selected_by",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "details": {
- "name": "details",
+ "selected_at": {
+ "name": "selected_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
"type": "jsonb",
"primaryKey": false,
+ "notNull": false
+ },
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
"notNull": true,
- "default": "'{}'::jsonb"
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -11839,26 +12379,51 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "channel_audit_channel_event_idx": {
- "name": "channel_audit_channel_event_idx",
+ "artboard_rounds_artboard_id_idx": {
+ "name": "artboard_rounds_artboard_id_idx",
"columns": [
{
- "expression": "channel_id",
+ "expression": "artboard_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_rounds_page_id_idx": {
+ "name": "artboard_rounds_page_id_idx",
+ "columns": [
{
- "expression": "event",
+ "expression": "page_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_rounds_user_id_idx": {
+ "name": "artboard_rounds_user_id_idx",
+ "columns": [
{
- "expression": "created_at",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -11869,47 +12434,118 @@
"method": "btree",
"with": {}
},
- "channel_audit_target_event_idx": {
- "name": "channel_audit_target_event_idx",
+ "artboard_rounds_workspace_id_idx": {
+ "name": "artboard_rounds_workspace_id_idx",
"columns": [
{
- "expression": "target_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "where": "\"artboard_rounds\".\"workspace_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_rounds_recommended_board_id_idx": {
+ "name": "artboard_rounds_recommended_board_id_idx",
+ "columns": [
{
- "expression": "event",
+ "expression": "recommended_board_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "where": "\"artboard_rounds\".\"recommended_board_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "artboard_rounds_chosen_board_id_idx": {
+ "name": "artboard_rounds_chosen_board_id_idx",
+ "columns": [
{
- "expression": "created_at",
+ "expression": "chosen_board_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"artboard_rounds\".\"chosen_board_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "channel_audit_channel_id_channels_id_fk": {
- "name": "channel_audit_channel_id_channels_id_fk",
- "tableFrom": "channel_audit",
- "tableTo": "channels",
- "columnsFrom": [
- "channel_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "artboard_rounds_artboard_id_artboards_id_fk": {
+ "name": "artboard_rounds_artboard_id_artboards_id_fk",
+ "tableFrom": "artboard_rounds",
+ "tableTo": "artboards",
+ "columnsFrom": ["artboard_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_rounds_page_id_artboard_pages_id_fk": {
+ "name": "artboard_rounds_page_id_artboard_pages_id_fk",
+ "tableFrom": "artboard_rounds",
+ "tableTo": "artboard_pages",
+ "columnsFrom": ["page_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "artboard_rounds_user_id_users_id_fk": {
+ "name": "artboard_rounds_user_id_users_id_fk",
+ "tableFrom": "artboard_rounds",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboard_rounds_workspace_id_workspaces_id_fk": {
+ "name": "artboard_rounds_workspace_id_workspaces_id_fk",
+ "tableFrom": "artboard_rounds",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
+ },
+ "artboard_rounds_recommended_board_id_artboard_boards_id_fk": {
+ "name": "artboard_rounds_recommended_board_id_artboard_boards_id_fk",
+ "tableFrom": "artboard_rounds",
+ "tableTo": "artboard_boards",
+ "columnsFrom": ["recommended_board_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "artboard_rounds_chosen_board_id_artboard_boards_id_fk": {
+ "name": "artboard_rounds_chosen_board_id_artboard_boards_id_fk",
+ "tableFrom": "artboard_rounds",
+ "tableTo": "artboard_boards",
+ "columnsFrom": ["chosen_board_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "artboard_rounds_selected_by_users_id_fk": {
+ "name": "artboard_rounds_selected_by_users_id_fk",
+ "tableFrom": "artboard_rounds",
+ "tableTo": "users",
+ "columnsFrom": ["selected_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@@ -11918,163 +12554,96 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.channel_jobs": {
- "name": "channel_jobs",
+ "public.artboards": {
+ "name": "artboards",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
- "primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
- },
- "channel_id": {
- "name": "channel_id",
"type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "member_id": {
- "name": "member_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
- },
- "message_id": {
- "name": "message_id",
- "type": "uuid",
- "primaryKey": false,
+ "primaryKey": true,
"notNull": true
},
- "thread_id": {
- "name": "thread_id",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "requester_member_id": {
- "name": "requester_member_id",
- "type": "uuid",
- "primaryKey": false,
"notNull": true
},
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'queued'"
- },
- "blocked_reason": {
- "name": "blocked_reason",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "blocked_code": {
- "name": "blocked_code",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "claimed_at": {
- "name": "claimed_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
"topic_id": {
"name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "operation_id": {
- "name": "operation_id",
+ "task_id": {
+ "name": "task_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "wake": {
- "name": "wake",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "manifest": {
- "name": "manifest",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "execution_config": {
- "name": "execution_config",
- "type": "jsonb",
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "device_id": {
- "name": "device_id",
- "type": "varchar(64)",
+ "acceptance_id": {
+ "name": "acceptance_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": false
},
- "working_directory": {
- "name": "working_directory",
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "accepted_at": {
- "name": "accepted_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "lease_owner": {
- "name": "lease_owner",
+ "description": {
+ "name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "lease_expires_at": {
- "name": "lease_expires_at",
- "type": "timestamp with time zone",
+ "content": {
+ "name": "content",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "writer_held": {
- "name": "writer_held",
- "type": "boolean",
+ "phase": {
+ "name": "phase",
+ "type": "text",
"primaryKey": false,
"notNull": true,
- "default": false
+ "default": "'discuss'"
},
- "isolated_at": {
- "name": "isolated_at",
- "type": "timestamp with time zone",
+ "revision": {
+ "name": "revision",
+ "type": "integer",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": 1
},
- "draft": {
- "name": "draft",
- "type": "text",
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "publication_revoked": {
- "name": "publication_revoked",
- "type": "boolean",
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
- "default": false
- },
- "published_message_id": {
- "name": "published_message_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": false
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -12092,119 +12661,74 @@
}
},
"indexes": {
- "channel_jobs_delivery_unique": {
- "name": "channel_jobs_delivery_unique",
+ "artboards_user_id_idx": {
+ "name": "artboards_user_id_idx",
"columns": [
{
- "expression": "message_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "member_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_jobs_channel_status_idx": {
- "name": "channel_jobs_channel_status_idx",
+ "artboards_workspace_id_idx": {
+ "name": "artboards_workspace_id_idx",
"columns": [
{
- "expression": "channel_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "status",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"artboards\".\"workspace_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_jobs_continuation_idx": {
- "name": "channel_jobs_continuation_idx",
+ "artboards_topic_id_idx": {
+ "name": "artboards_topic_id_idx",
"columns": [
{
- "expression": "member_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "requester_member_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "thread_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "claimed_at",
+ "expression": "topic_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"artboards\".\"topic_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_jobs_topic_idx": {
- "name": "channel_jobs_topic_idx",
+ "artboards_task_id_idx": {
+ "name": "artboards_task_id_idx",
"columns": [
{
- "expression": "topic_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "published_message_id",
+ "expression": "task_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"artboards\".\"task_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_jobs_member_queue_idx": {
- "name": "channel_jobs_member_queue_idx",
+ "artboards_project_id_idx": {
+ "name": "artboards_project_id_idx",
"columns": [
{
- "expression": "member_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "status",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "created_at",
+ "expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -12215,186 +12739,1876 @@
"method": "btree",
"with": {}
},
- "channel_jobs_lease_expires_idx": {
- "name": "channel_jobs_lease_expires_idx",
+ "artboards_phase_idx": {
+ "name": "artboards_phase_idx",
"columns": [
{
- "expression": "lease_expires_at",
+ "expression": "phase",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"channel_jobs\".\"writer_held\" AND \"channel_jobs\".\"isolated_at\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_jobs_active_member_unique": {
- "name": "channel_jobs_active_member_unique",
+ "artboards_created_at_idx": {
+ "name": "artboards_created_at_idx",
"columns": [
{
- "expression": "member_id",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"channel_jobs\".\"writer_held\" AND \"channel_jobs\".\"isolated_at\" IS NULL",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_jobs_active_directory_unique": {
- "name": "channel_jobs_active_directory_unique",
+ "artboards_updated_at_idx": {
+ "name": "artboards_updated_at_idx",
"columns": [
{
- "expression": "device_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "working_directory",
+ "expression": "updated_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"channel_jobs\".\"device_id\" IS NOT NULL AND \"channel_jobs\".\"working_directory\" IS NOT NULL AND \"channel_jobs\".\"writer_held\"",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "channel_jobs_channel_id_channels_id_fk": {
- "name": "channel_jobs_channel_id_channels_id_fk",
- "tableFrom": "channel_jobs",
- "tableTo": "channels",
- "columnsFrom": [
- "channel_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "artboards_user_id_users_id_fk": {
+ "name": "artboards_user_id_users_id_fk",
+ "tableFrom": "artboards",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "channel_jobs_topic_id_topics_id_fk": {
- "name": "channel_jobs_topic_id_topics_id_fk",
- "tableFrom": "channel_jobs",
+ "artboards_workspace_id_workspaces_id_fk": {
+ "name": "artboards_workspace_id_workspaces_id_fk",
+ "tableFrom": "artboards",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "artboards_topic_id_topics_id_fk": {
+ "name": "artboards_topic_id_topics_id_fk",
+ "tableFrom": "artboards",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
- "channel_jobs_operation_id_agent_operations_id_fk": {
- "name": "channel_jobs_operation_id_agent_operations_id_fk",
- "tableFrom": "channel_jobs",
- "tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "artboards_task_id_tasks_id_fk": {
+ "name": "artboards_task_id_tasks_id_fk",
+ "tableFrom": "artboards",
+ "tableTo": "tasks",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
- "channel_jobs_member_fk": {
- "name": "channel_jobs_member_fk",
+ "artboards_project_id_projects_id_fk": {
+ "name": "artboards_project_id_projects_id_fk",
+ "tableFrom": "artboards",
+ "tableTo": "projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "artboards_acceptance_id_acceptances_id_fk": {
+ "name": "artboards_acceptance_id_acceptances_id_fk",
+ "tableFrom": "artboards",
+ "tableTo": "acceptances",
+ "columnsFrom": ["acceptance_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.async_tasks": {
+ "name": "async_tasks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error": {
+ "name": "error",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "inference_id": {
+ "name": "inference_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "async_tasks_user_id_idx": {
+ "name": "async_tasks_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "async_tasks_parent_id_idx": {
+ "name": "async_tasks_parent_id_idx",
+ "columns": [
+ {
+ "expression": "parent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "async_tasks_type_status_idx": {
+ "name": "async_tasks_type_status_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "async_tasks_inference_id_idx": {
+ "name": "async_tasks_inference_id_idx",
+ "columns": [
+ {
+ "expression": "inference_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "async_tasks_metadata_idx": {
+ "name": "async_tasks_metadata_idx",
+ "columns": [
+ {
+ "expression": "metadata",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "gin",
+ "with": {}
+ },
+ "async_tasks_workspace_id_idx": {
+ "name": "async_tasks_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "async_tasks_user_id_users_id_fk": {
+ "name": "async_tasks_user_id_users_id_fk",
+ "tableFrom": "async_tasks",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "async_tasks_workspace_id_workspaces_id_fk": {
+ "name": "async_tasks_workspace_id_workspaces_id_fk",
+ "tableFrom": "async_tasks",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.accounts": {
+ "name": "accounts",
+ "schema": "",
+ "columns": {
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_token_expires_at": {
+ "name": "access_token_expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "account_id": {
+ "name": "account_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "id_token": {
+ "name": "id_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_token": {
+ "name": "refresh_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_token_expires_at": {
+ "name": "refresh_token_expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "account_userId_idx": {
+ "name": "account_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "accounts_user_id_users_id_fk": {
+ "name": "accounts_user_id_users_id_fk",
+ "tableFrom": "accounts",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.passkey": {
+ "name": "passkey",
+ "schema": "",
+ "columns": {
+ "aaguid": {
+ "name": "aaguid",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backedUp": {
+ "name": "backedUp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "counter": {
+ "name": "counter",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "credentialID": {
+ "name": "credentialID",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deviceType": {
+ "name": "deviceType",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "publicKey": {
+ "name": "publicKey",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "transports": {
+ "name": "transports",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "userId": {
+ "name": "userId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "passkey_credential_id_unique": {
+ "name": "passkey_credential_id_unique",
+ "columns": [
+ {
+ "expression": "credentialID",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "passkey_user_id_idx": {
+ "name": "passkey_user_id_idx",
+ "columns": [
+ {
+ "expression": "userId",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "passkey_userId_users_id_fk": {
+ "name": "passkey_userId_users_id_fk",
+ "tableFrom": "passkey",
+ "tableTo": "users",
+ "columnsFrom": ["userId"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.auth_sessions": {
+ "name": "auth_sessions",
+ "schema": "",
+ "columns": {
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "impersonated_by": {
+ "name": "impersonated_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "auth_session_userId_idx": {
+ "name": "auth_session_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "auth_sessions_user_id_users_id_fk": {
+ "name": "auth_sessions_user_id_users_id_fk",
+ "tableFrom": "auth_sessions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "auth_sessions_token_unique": {
+ "name": "auth_sessions_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.two_factor": {
+ "name": "two_factor",
+ "schema": "",
+ "columns": {
+ "backup_codes": {
+ "name": "backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "secret": {
+ "name": "secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "two_factor_secret_idx": {
+ "name": "two_factor_secret_idx",
+ "columns": [
+ {
+ "expression": "secret",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "two_factor_user_id_idx": {
+ "name": "two_factor_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "two_factor_user_id_users_id_fk": {
+ "name": "two_factor_user_id_users_id_fk",
+ "tableFrom": "two_factor",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.verifications": {
+ "name": "verifications",
+ "schema": "",
+ "columns": {
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "verification_identifier_idx": {
+ "name": "verification_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.channel_audit": {
+ "name": "channel_audit",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event": {
+ "name": "event",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "details": {
+ "name": "details",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "channel_audit_channel_event_idx": {
+ "name": "channel_audit_channel_event_idx",
+ "columns": [
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "event",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_audit_target_event_idx": {
+ "name": "channel_audit_target_event_idx",
+ "columns": [
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "event",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "channel_audit_channel_id_channels_id_fk": {
+ "name": "channel_audit_channel_id_channels_id_fk",
+ "tableFrom": "channel_audit",
+ "tableTo": "channels",
+ "columnsFrom": ["channel_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.channel_jobs": {
+ "name": "channel_jobs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "thread_id": {
+ "name": "thread_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requester_member_id": {
+ "name": "requester_member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'queued'"
+ },
+ "blocked_reason": {
+ "name": "blocked_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "blocked_code": {
+ "name": "blocked_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "claimed_at": {
+ "name": "claimed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "topic_id": {
+ "name": "topic_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "operation_id": {
+ "name": "operation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wake": {
+ "name": "wake",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "manifest": {
+ "name": "manifest",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "execution_config": {
+ "name": "execution_config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "working_directory": {
+ "name": "working_directory",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accepted_at": {
+ "name": "accepted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner": {
+ "name": "lease_owner",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "writer_held": {
+ "name": "writer_held",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "isolated_at": {
+ "name": "isolated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft": {
+ "name": "draft",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "publication_revoked": {
+ "name": "publication_revoked",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "published_message_id": {
+ "name": "published_message_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": {
+ "channel_jobs_delivery_unique": {
+ "name": "channel_jobs_delivery_unique",
+ "columns": [
+ {
+ "expression": "message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_jobs_channel_status_idx": {
+ "name": "channel_jobs_channel_status_idx",
+ "columns": [
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_jobs_continuation_idx": {
+ "name": "channel_jobs_continuation_idx",
+ "columns": [
+ {
+ "expression": "member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "requester_member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "claimed_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_jobs_topic_idx": {
+ "name": "channel_jobs_topic_idx",
+ "columns": [
+ {
+ "expression": "topic_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "published_message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_jobs_member_queue_idx": {
+ "name": "channel_jobs_member_queue_idx",
+ "columns": [
+ {
+ "expression": "member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_jobs_lease_expires_idx": {
+ "name": "channel_jobs_lease_expires_idx",
+ "columns": [
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"channel_jobs\".\"writer_held\" AND \"channel_jobs\".\"isolated_at\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_jobs_active_directory_idx": {
+ "name": "channel_jobs_active_directory_idx",
+ "columns": [
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "working_directory",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"channel_jobs\".\"writer_held\"",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "channel_jobs_channel_id_channels_id_fk": {
+ "name": "channel_jobs_channel_id_channels_id_fk",
+ "tableFrom": "channel_jobs",
+ "tableTo": "channels",
+ "columnsFrom": ["channel_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "channel_jobs_topic_id_topics_id_fk": {
+ "name": "channel_jobs_topic_id_topics_id_fk",
+ "tableFrom": "channel_jobs",
+ "tableTo": "topics",
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "channel_jobs_operation_id_agent_operations_id_fk": {
+ "name": "channel_jobs_operation_id_agent_operations_id_fk",
+ "tableFrom": "channel_jobs",
+ "tableTo": "agent_operations",
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "channel_jobs_member_fk": {
+ "name": "channel_jobs_member_fk",
+ "tableFrom": "channel_jobs",
+ "tableTo": "channel_members",
+ "columnsFrom": ["channel_id", "member_id"],
+ "columnsTo": ["channel_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "channel_jobs_requester_fk": {
+ "name": "channel_jobs_requester_fk",
"tableFrom": "channel_jobs",
"tableTo": "channel_members",
- "columnsFrom": [
- "channel_id",
- "member_id"
+ "columnsFrom": ["channel_id", "requester_member_id"],
+ "columnsTo": ["channel_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "channel_jobs_message_fk": {
+ "name": "channel_jobs_message_fk",
+ "tableFrom": "channel_jobs",
+ "tableTo": "channel_messages",
+ "columnsFrom": ["channel_id", "message_id"],
+ "columnsTo": ["channel_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "channel_jobs_thread_fk": {
+ "name": "channel_jobs_thread_fk",
+ "tableFrom": "channel_jobs",
+ "tableTo": "channel_threads",
+ "columnsFrom": ["channel_id", "thread_id"],
+ "columnsTo": ["channel_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "channel_jobs_operation_id_unique": {
+ "name": "channel_jobs_operation_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["operation_id"]
+ },
+ "channel_jobs_scope_unique": {
+ "name": "channel_jobs_scope_unique",
+ "nullsNotDistinct": false,
+ "columns": ["channel_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.channel_member_grants": {
+ "name": "channel_member_grants",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_owner_id": {
+ "name": "device_owner_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "working_directory": {
+ "name": "working_directory",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requested_by_member_id": {
+ "name": "requested_by_member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "decided_at": {
+ "name": "decided_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revoke_reason": {
+ "name": "revoke_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'{}'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "channel_member_grants_member_unique": {
+ "name": "channel_member_grants_member_unique",
+ "columns": [
+ {
+ "expression": "member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
],
- "columnsTo": [
- "channel_id",
- "id"
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_member_grants_owner_status_idx": {
+ "name": "channel_member_grants_owner_status_idx",
+ "columns": [
+ {
+ "expression": "device_owner_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "channel_member_grants_channel_id_channels_id_fk": {
+ "name": "channel_member_grants_channel_id_channels_id_fk",
+ "tableFrom": "channel_member_grants",
+ "tableTo": "channels",
+ "columnsFrom": ["channel_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "channel_member_grants_device_owner_id_users_id_fk": {
+ "name": "channel_member_grants_device_owner_id_users_id_fk",
+ "tableFrom": "channel_member_grants",
+ "tableTo": "users",
+ "columnsFrom": ["device_owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "channel_member_grants_member_fk": {
+ "name": "channel_member_grants_member_fk",
+ "tableFrom": "channel_member_grants",
+ "tableTo": "channel_members",
+ "columnsFrom": ["channel_id", "member_id"],
+ "columnsTo": ["channel_id", "id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "channel_member_grants_requester_fk": {
+ "name": "channel_member_grants_requester_fk",
+ "tableFrom": "channel_member_grants",
+ "tableTo": "channel_members",
+ "columnsFrom": ["channel_id", "requested_by_member_id"],
+ "columnsTo": ["channel_id", "id"],
"onDelete": "no action",
"onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.channel_members": {
+ "name": "channel_members",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "actor_type": {
+ "name": "actor_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_read_sequence": {
+ "name": "last_read_sequence",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "section_id": {
+ "name": "section_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pinned": {
+ "name": "pinned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "hidden": {
+ "name": "hidden",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_id": {
+ "name": "agent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "config": {
+ "name": "config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'{}'::jsonb"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'active'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "channel_members_channel_user_unique": {
+ "name": "channel_members_channel_user_unique",
+ "columns": [
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"channel_members\".\"user_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_members_user_id_idx": {
+ "name": "channel_members_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_members_section_id_idx": {
+ "name": "channel_members_section_id_idx",
+ "columns": [
+ {
+ "expression": "section_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"channel_members\".\"section_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_members_agent_id_idx": {
+ "name": "channel_members_agent_id_idx",
+ "columns": [
+ {
+ "expression": "agent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "channel_members_channel_id_channels_id_fk": {
+ "name": "channel_members_channel_id_channels_id_fk",
+ "tableFrom": "channel_members",
+ "tableTo": "channels",
+ "columnsFrom": ["channel_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "channel_members_user_id_users_id_fk": {
+ "name": "channel_members_user_id_users_id_fk",
+ "tableFrom": "channel_members",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "channel_members_section_id_channel_sections_id_fk": {
+ "name": "channel_members_section_id_channel_sections_id_fk",
+ "tableFrom": "channel_members",
+ "tableTo": "channel_sections",
+ "columnsFrom": ["section_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "channel_members_agent_id_agents_id_fk": {
+ "name": "channel_members_agent_id_agents_id_fk",
+ "tableFrom": "channel_members",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "channel_members_scope_unique": {
+ "name": "channel_members_scope_unique",
+ "nullsNotDistinct": false,
+ "columns": ["channel_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "channel_members_actor_type_check": {
+ "name": "channel_members_actor_type_check",
+ "value": "\"channel_members\".\"actor_type\" IN ('user', 'agent')"
+ },
+ "channel_members_user_shape_check": {
+ "name": "channel_members_user_shape_check",
+ "value": "\"channel_members\".\"actor_type\" <> 'user' OR \"channel_members\".\"role\" IS NOT NULL"
+ },
+ "channel_members_agent_shape_check": {
+ "name": "channel_members_agent_shape_check",
+ "value": "\"channel_members\".\"actor_type\" <> 'agent' OR (\"channel_members\".\"name\" IS NOT NULL AND \"channel_members\".\"config\" IS NOT NULL)"
+ },
+ "channel_members_user_id_owner_check": {
+ "name": "channel_members_user_id_owner_check",
+ "value": "\"channel_members\".\"user_id\" IS NULL OR \"channel_members\".\"actor_type\" = 'user'"
+ },
+ "channel_members_role_owner_check": {
+ "name": "channel_members_role_owner_check",
+ "value": "\"channel_members\".\"role\" IS NULL OR \"channel_members\".\"actor_type\" = 'user'"
+ },
+ "channel_members_agent_id_owner_check": {
+ "name": "channel_members_agent_id_owner_check",
+ "value": "\"channel_members\".\"agent_id\" IS NULL OR \"channel_members\".\"actor_type\" = 'agent'"
+ },
+ "channel_members_section_id_owner_check": {
+ "name": "channel_members_section_id_owner_check",
+ "value": "\"channel_members\".\"section_id\" IS NULL OR \"channel_members\".\"actor_type\" = 'user'"
+ },
+ "channel_members_config_owner_check": {
+ "name": "channel_members_config_owner_check",
+ "value": "\"channel_members\".\"config\" IS NULL OR \"channel_members\".\"actor_type\" <> 'user'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.channel_message_files": {
+ "name": "channel_message_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_id": {
+ "name": "file_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
},
- "channel_jobs_requester_fk": {
- "name": "channel_jobs_requester_fk",
- "tableFrom": "channel_jobs",
- "tableTo": "channel_members",
- "columnsFrom": [
- "channel_id",
- "requester_member_id"
- ],
- "columnsTo": [
- "channel_id",
- "id"
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "channel_message_files_file_idx": {
+ "name": "channel_message_files_file_idx",
+ "columns": [
+ {
+ "expression": "file_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
],
- "onDelete": "no action",
- "onUpdate": "no action"
- },
- "channel_jobs_message_fk": {
- "name": "channel_jobs_message_fk",
- "tableFrom": "channel_jobs",
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "channel_message_files_message_id_channel_messages_id_fk": {
+ "name": "channel_message_files_message_id_channel_messages_id_fk",
+ "tableFrom": "channel_message_files",
"tableTo": "channel_messages",
- "columnsFrom": [
- "channel_id",
- "message_id"
- ],
- "columnsTo": [
- "channel_id",
- "id"
- ],
- "onDelete": "no action",
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "channel_jobs_thread_fk": {
- "name": "channel_jobs_thread_fk",
- "tableFrom": "channel_jobs",
- "tableTo": "channel_threads",
- "columnsFrom": [
- "channel_id",
- "thread_id"
- ],
- "columnsTo": [
- "channel_id",
- "id"
- ],
- "onDelete": "no action",
+ "channel_message_files_file_id_files_id_fk": {
+ "name": "channel_message_files_file_id_files_id_fk",
+ "tableFrom": "channel_message_files",
+ "tableTo": "files",
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
- "channel_jobs_operation_id_unique": {
- "name": "channel_jobs_operation_id_unique",
- "nullsNotDistinct": false,
- "columns": [
- "operation_id"
- ]
- },
- "channel_jobs_scope_unique": {
- "name": "channel_jobs_scope_unique",
+ "channel_message_files_message_file_unique": {
+ "name": "channel_message_files_message_file_unique",
"nullsNotDistinct": false,
- "columns": [
- "channel_id",
- "id"
- ]
+ "columns": ["message_id", "file_id"]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.channel_member_grants": {
- "name": "channel_member_grants",
+ "public.channel_messages": {
+ "name": "channel_messages",
"schema": "",
"columns": {
"id": {
@@ -12410,61 +14624,87 @@
"primaryKey": false,
"notNull": true
},
- "member_id": {
- "name": "member_id",
- "type": "uuid",
+ "thread_id": {
+ "name": "thread_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "integer",
"primaryKey": false,
"notNull": true
},
- "device_owner_id": {
- "name": "device_owner_id",
+ "content": {
+ "name": "content",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "device_id": {
- "name": "device_id",
- "type": "varchar(64)",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "working_directory": {
- "name": "working_directory",
+ "agent_id": {
+ "name": "agent_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "requested_by_member_id": {
- "name": "requested_by_member_id",
- "type": "uuid",
+ "mentions": {
+ "name": "mentions",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "'[]'::jsonb"
},
- "status": {
- "name": "status",
+ "request_key": {
+ "name": "request_key",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'pending'"
+ "notNull": true
},
- "decided_at": {
- "name": "decided_at",
- "type": "timestamp with time zone",
+ "reply_to_id": {
+ "name": "reply_to_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": false
},
- "revoked_at": {
- "name": "revoked_at",
- "type": "timestamp with time zone",
+ "routing_status": {
+ "name": "routing_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "routing_source": {
+ "name": "routing_source",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "revoke_reason": {
- "name": "revoke_reason",
+ "routing_reason": {
+ "name": "routing_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
+ "routing_attempt": {
+ "name": "routing_attempt",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "recipient_member_ids": {
+ "name": "recipient_member_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
"metadata": {
"name": "metadata",
"type": "jsonb",
@@ -12478,21 +14718,20 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
- },
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
}
},
"indexes": {
- "channel_member_grants_member_unique": {
- "name": "channel_member_grants_member_unique",
+ "channel_messages_sequence_unique": {
+ "name": "channel_messages_sequence_unique",
"columns": [
{
- "expression": "member_id",
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -12503,113 +14742,403 @@
"method": "btree",
"with": {}
},
- "channel_member_grants_owner_status_idx": {
- "name": "channel_member_grants_owner_status_idx",
+ "channel_messages_request_key_unique": {
+ "name": "channel_messages_request_key_unique",
"columns": [
{
- "expression": "device_owner_id",
+ "expression": "channel_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "status",
+ "expression": "request_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_messages_thread_sequence_idx": {
+ "name": "channel_messages_thread_sequence_idx",
+ "columns": [
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_messages_request_sequence_idx": {
+ "name": "channel_messages_request_sequence_idx",
+ "columns": [
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sequence",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"channel_messages\".\"routing_status\" <> 'reply'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channel_messages_routing_pending_idx": {
+ "name": "channel_messages_routing_pending_idx",
+ "columns": [
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"channel_messages\".\"routing_status\" = 'pending'",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "channel_member_grants_channel_id_channels_id_fk": {
- "name": "channel_member_grants_channel_id_channels_id_fk",
- "tableFrom": "channel_member_grants",
+ "channel_messages_channel_id_channels_id_fk": {
+ "name": "channel_messages_channel_id_channels_id_fk",
+ "tableFrom": "channel_messages",
"tableTo": "channels",
- "columnsFrom": [
- "channel_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["channel_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "channel_member_grants_device_owner_id_users_id_fk": {
- "name": "channel_member_grants_device_owner_id_users_id_fk",
- "tableFrom": "channel_member_grants",
+ "channel_messages_user_id_users_id_fk": {
+ "name": "channel_messages_user_id_users_id_fk",
+ "tableFrom": "channel_messages",
"tableTo": "users",
- "columnsFrom": [
- "device_owner_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
"onUpdate": "no action"
},
- "channel_member_grants_member_fk": {
- "name": "channel_member_grants_member_fk",
- "tableFrom": "channel_member_grants",
- "tableTo": "channel_members",
- "columnsFrom": [
- "channel_id",
- "member_id"
- ],
- "columnsTo": [
- "channel_id",
- "id"
- ],
+ "channel_messages_agent_id_agents_id_fk": {
+ "name": "channel_messages_agent_id_agents_id_fk",
+ "tableFrom": "channel_messages",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "channel_messages_thread_fk": {
+ "name": "channel_messages_thread_fk",
+ "tableFrom": "channel_messages",
+ "tableTo": "channel_threads",
+ "columnsFrom": ["channel_id", "thread_id"],
+ "columnsTo": ["channel_id", "id"],
"onDelete": "no action",
"onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "channel_messages_scope_unique": {
+ "name": "channel_messages_scope_unique",
+ "nullsNotDistinct": false,
+ "columns": ["channel_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "channel_messages_sender_check": {
+ "name": "channel_messages_sender_check",
+ "value": "\"channel_messages\".\"user_id\" IS NULL OR \"channel_messages\".\"agent_id\" IS NULL"
},
- "channel_member_grants_requester_fk": {
- "name": "channel_member_grants_requester_fk",
- "tableFrom": "channel_member_grants",
- "tableTo": "channel_members",
- "columnsFrom": [
- "channel_id",
- "requested_by_member_id"
+ "channel_messages_user_sender_check": {
+ "name": "channel_messages_user_sender_check",
+ "value": "\"channel_messages\".\"routing_status\" <> 'reply' OR \"channel_messages\".\"user_id\" IS NULL"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.channel_sections": {
+ "name": "channel_sections",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sort": {
+ "name": "sort",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "collapsed": {
+ "name": "collapsed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "channel_sections_user_id_workspace_id_idx": {
+ "name": "channel_sections_user_id_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
],
- "columnsTo": [
- "channel_id",
- "id"
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "channel_sections_user_id_users_id_fk": {
+ "name": "channel_sections_user_id_users_id_fk",
+ "tableFrom": "channel_sections",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "channel_sections_workspace_id_workspaces_id_fk": {
+ "name": "channel_sections_workspace_id_workspaces_id_fk",
+ "tableFrom": "channel_sections",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.channel_threads": {
+ "name": "channel_threads",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "root_message_id": {
+ "name": "root_message_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "root_sequence": {
+ "name": "root_sequence",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "follower_member_ids": {
+ "name": "follower_member_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'active'"
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'{}'::jsonb"
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "channel_threads_root_unique": {
+ "name": "channel_threads_root_unique",
+ "columns": [
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "root_message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
],
+ "isUnique": true,
+ "where": "\"channel_threads\".\"is_deleted\" IS NOT TRUE",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "channel_threads_channel_id_channels_id_fk": {
+ "name": "channel_threads_channel_id_channels_id_fk",
+ "tableFrom": "channel_threads",
+ "tableTo": "channels",
+ "columnsFrom": ["channel_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "channel_threads_root_fk": {
+ "name": "channel_threads_root_fk",
+ "tableFrom": "channel_threads",
+ "tableTo": "channel_messages",
+ "columnsFrom": ["channel_id", "root_message_id"],
+ "columnsTo": ["channel_id", "id"],
"onDelete": "no action",
"onUpdate": "no action"
}
},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "channel_threads_scope_unique": {
+ "name": "channel_threads_scope_unique",
+ "nullsNotDistinct": false,
+ "columns": ["channel_id", "id"]
+ }
+ },
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.channel_members": {
- "name": "channel_members",
+ "public.channels": {
+ "name": "channels",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
- "primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
- },
- "channel_id": {
- "name": "channel_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "actor_type": {
- "name": "actor_type",
"type": "text",
- "primaryKey": false,
+ "primaryKey": true,
"notNull": true
},
"user_id": {
@@ -12618,15 +15147,15 @@
"primaryKey": false,
"notNull": false
},
- "role": {
- "name": "role",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "last_read_sequence": {
- "name": "last_read_sequence",
- "type": "integer",
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
@@ -12636,18 +15165,44 @@
"primaryKey": false,
"notNull": false
},
- "name": {
- "name": "name",
+ "peer_user_id": {
+ "name": "peer_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "description": {
- "name": "description",
+ "agent_pair_key": {
+ "name": "agent_pair_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sequence": {
+ "name": "sequence",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "status": {
+ "name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
- "default": "''"
+ "default": "'active'"
+ },
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
},
"config": {
"name": "config",
@@ -12662,12 +15217,17 @@
"notNull": false,
"default": "'{}'::jsonb"
},
- "status": {
- "name": "status",
- "type": "text",
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true,
- "default": "'active'"
+ "notNull": false
+ },
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
},
"created_at": {
"name": "created_at",
@@ -12685,11 +15245,26 @@
}
},
"indexes": {
- "channel_members_channel_user_unique": {
- "name": "channel_members_channel_user_unique",
+ "channels_user_id_idx": {
+ "name": "channels_user_id_idx",
"columns": [
{
- "expression": "channel_id",
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "channels_direct_unique": {
+ "name": "channels_direct_unique",
+ "columns": [
+ {
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -12699,166 +15274,75 @@
"isExpression": false,
"asc": true,
"nulls": "last"
+ },
+ {
+ "expression": "coalesce(\"workspace_id\", '')",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
}
],
"isUnique": true,
- "where": "\"channel_members\".\"user_id\" IS NOT NULL",
+ "where": "\"channels\".\"agent_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_members_user_id_idx": {
- "name": "channel_members_user_id_idx",
+ "channels_agent_pair_unique": {
+ "name": "channels_agent_pair_unique",
"columns": [
+ {
+ "expression": "agent_pair_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
+ },
+ {
+ "expression": "coalesce(\"workspace_id\", '')",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"channels\".\"agent_pair_key\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_members_agent_id_idx": {
- "name": "channel_members_agent_id_idx",
+ "channels_project_id_idx": {
+ "name": "channels_project_id_idx",
"columns": [
{
- "expression": "agent_id",
+ "expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"channels\".\"project_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
- }
- },
- "foreignKeys": {
- "channel_members_channel_id_channels_id_fk": {
- "name": "channel_members_channel_id_channels_id_fk",
- "tableFrom": "channel_members",
- "tableTo": "channels",
- "columnsFrom": [
- "channel_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "channel_members_user_id_users_id_fk": {
- "name": "channel_members_user_id_users_id_fk",
- "tableFrom": "channel_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "channel_members_agent_id_agents_id_fk": {
- "name": "channel_members_agent_id_agents_id_fk",
- "tableFrom": "channel_members",
- "tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {
- "channel_members_scope_unique": {
- "name": "channel_members_scope_unique",
- "nullsNotDistinct": false,
- "columns": [
- "channel_id",
- "id"
- ]
- }
- },
- "policies": {},
- "checkConstraints": {
- "channel_members_actor_type_check": {
- "name": "channel_members_actor_type_check",
- "value": "\"channel_members\".\"actor_type\" IN ('user', 'agent')"
- },
- "channel_members_user_shape_check": {
- "name": "channel_members_user_shape_check",
- "value": "\"channel_members\".\"actor_type\" <> 'user' OR \"channel_members\".\"role\" IS NOT NULL"
- },
- "channel_members_agent_shape_check": {
- "name": "channel_members_agent_shape_check",
- "value": "\"channel_members\".\"actor_type\" <> 'agent' OR (\"channel_members\".\"name\" IS NOT NULL AND \"channel_members\".\"config\" IS NOT NULL)"
- },
- "channel_members_user_id_owner_check": {
- "name": "channel_members_user_id_owner_check",
- "value": "\"channel_members\".\"user_id\" IS NULL OR \"channel_members\".\"actor_type\" = 'user'"
- },
- "channel_members_role_owner_check": {
- "name": "channel_members_role_owner_check",
- "value": "\"channel_members\".\"role\" IS NULL OR \"channel_members\".\"actor_type\" = 'user'"
- },
- "channel_members_agent_id_owner_check": {
- "name": "channel_members_agent_id_owner_check",
- "value": "\"channel_members\".\"agent_id\" IS NULL OR \"channel_members\".\"actor_type\" = 'agent'"
- },
- "channel_members_config_owner_check": {
- "name": "channel_members_config_owner_check",
- "value": "\"channel_members\".\"config\" IS NULL OR \"channel_members\".\"actor_type\" <> 'user'"
- }
- },
- "isRLSEnabled": false
- },
- "public.channel_message_files": {
- "name": "channel_message_files",
- "schema": "",
- "columns": {
- "id": {
- "name": "id",
- "type": "uuid",
- "primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
- },
- "message_id": {
- "name": "message_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
- },
- "file_id": {
- "name": "file_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
},
- "sort_order": {
- "name": "sort_order",
- "type": "integer",
- "primaryKey": false,
- "notNull": true
- }
- },
- "indexes": {
- "channel_message_files_file_idx": {
- "name": "channel_message_files_file_idx",
+ "channels_workspace_visibility_idx": {
+ "name": "channels_workspace_visibility_idx",
"columns": [
{
- "expression": "file_id",
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "visibility",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -12871,152 +15355,177 @@
}
},
"foreignKeys": {
- "channel_message_files_message_id_channel_messages_id_fk": {
- "name": "channel_message_files_message_id_channel_messages_id_fk",
- "tableFrom": "channel_message_files",
- "tableTo": "channel_messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "channels_user_id_users_id_fk": {
+ "name": "channels_user_id_users_id_fk",
+ "tableFrom": "channels",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "channels_workspace_id_workspaces_id_fk": {
+ "name": "channels_workspace_id_workspaces_id_fk",
+ "tableFrom": "channels",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "channel_message_files_file_id_files_id_fk": {
- "name": "channel_message_files_file_id_files_id_fk",
- "tableFrom": "channel_message_files",
- "tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "channels_project_id_projects_id_fk": {
+ "name": "channels_project_id_projects_id_fk",
+ "tableFrom": "channels",
+ "tableTo": "projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "channels_agent_id_agents_id_fk": {
+ "name": "channels_agent_id_agents_id_fk",
+ "tableFrom": "channels",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "channels_peer_user_id_users_id_fk": {
+ "name": "channels_peer_user_id_users_id_fk",
+ "tableFrom": "channels",
+ "tableTo": "users",
+ "columnsFrom": ["peer_user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
- "uniqueConstraints": {
- "channel_message_files_message_file_unique": {
- "name": "channel_message_files_message_file_unique",
- "nullsNotDistinct": false,
- "columns": [
- "message_id",
- "file_id"
- ]
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "channels_direct_visibility_check": {
+ "name": "channels_direct_visibility_check",
+ "value": "\"channels\".\"agent_id\" IS NULL OR \"channels\".\"visibility\" = 'private'"
}
},
- "policies": {},
- "checkConstraints": {},
"isRLSEnabled": false
},
- "public.channel_messages": {
- "name": "channel_messages",
+ "public.chat_groups": {
+ "name": "chat_groups",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
+ "type": "text",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
},
- "channel_id": {
- "name": "channel_id",
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "thread_id": {
- "name": "thread_id",
+ "description": {
+ "name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "sequence": {
- "name": "sequence",
- "type": "integer",
+ "avatar": {
+ "name": "avatar",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "content": {
- "name": "content",
+ "background_color": {
+ "name": "background_color",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "user_id": {
- "name": "user_id",
+ "market_identifier": {
+ "name": "market_identifier",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "agent_id": {
- "name": "agent_id",
+ "content": {
+ "name": "content",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "mentions": {
- "name": "mentions",
+ "editor_data": {
+ "name": "editor_data",
"type": "jsonb",
"primaryKey": false,
- "notNull": true,
- "default": "'[]'::jsonb"
+ "notNull": false
},
- "request_key": {
- "name": "request_key",
- "type": "text",
+ "config": {
+ "name": "config",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "reply_to_id": {
- "name": "reply_to_id",
- "type": "uuid",
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "routing_status": {
- "name": "routing_status",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "routing_source": {
- "name": "routing_source",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "routing_reason": {
- "name": "routing_reason",
+ "group_id": {
+ "name": "group_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "routing_attempt": {
- "name": "routing_attempt",
- "type": "integer",
+ "pinned": {
+ "name": "pinned",
+ "type": "boolean",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": false,
+ "default": false
},
- "recipient_member_ids": {
- "name": "recipient_member_ids",
- "type": "jsonb",
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
"primaryKey": false,
"notNull": true,
- "default": "'[]'::jsonb"
+ "default": "'public'"
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false,
- "default": "'{}'::jsonb"
+ "notNull": false
+ },
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -13024,20 +15533,27 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "channel_messages_sequence_unique": {
- "name": "channel_messages_sequence_unique",
+ "chat_groups_client_id_user_id_unique": {
+ "name": "chat_groups_client_id_user_id_unique",
"columns": [
{
- "expression": "channel_id",
+ "expression": "client_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "sequence",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -13048,44 +15564,26 @@
"method": "btree",
"with": {}
},
- "channel_messages_request_key_unique": {
- "name": "channel_messages_request_key_unique",
+ "chat_groups_user_id_idx": {
+ "name": "chat_groups_user_id_idx",
"columns": [
{
- "expression": "channel_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "request_key",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_messages_thread_sequence_idx": {
- "name": "channel_messages_thread_sequence_idx",
+ "chat_groups_group_id_idx": {
+ "name": "chat_groups_group_id_idx",
"columns": [
{
- "expression": "channel_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "thread_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "sequence",
+ "expression": "group_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -13096,201 +15594,139 @@
"method": "btree",
"with": {}
},
- "channel_messages_request_sequence_idx": {
- "name": "channel_messages_request_sequence_idx",
+ "chat_groups_workspace_id_idx": {
+ "name": "chat_groups_workspace_id_idx",
"columns": [
{
- "expression": "channel_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "thread_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "sequence",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"channel_messages\".\"routing_status\" <> 'reply'",
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_messages_routing_pending_idx": {
- "name": "channel_messages_routing_pending_idx",
+ "chat_groups_workspace_visibility_idx": {
+ "name": "chat_groups_workspace_visibility_idx",
"columns": [
{
- "expression": "channel_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "id",
+ "expression": "visibility",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"channel_messages\".\"routing_status\" = 'pending'",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "channel_messages_channel_id_channels_id_fk": {
- "name": "channel_messages_channel_id_channels_id_fk",
- "tableFrom": "channel_messages",
- "tableTo": "channels",
- "columnsFrom": [
- "channel_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "chat_groups_user_id_users_id_fk": {
+ "name": "chat_groups_user_id_users_id_fk",
+ "tableFrom": "chat_groups",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "channel_messages_user_id_users_id_fk": {
- "name": "channel_messages_user_id_users_id_fk",
- "tableFrom": "channel_messages",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
+ "chat_groups_workspace_id_workspaces_id_fk": {
+ "name": "chat_groups_workspace_id_workspaces_id_fk",
+ "tableFrom": "chat_groups",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "channel_messages_agent_id_agents_id_fk": {
- "name": "channel_messages_agent_id_agents_id_fk",
- "tableFrom": "channel_messages",
- "tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "chat_groups_group_id_session_groups_id_fk": {
+ "name": "chat_groups_group_id_session_groups_id_fk",
+ "tableFrom": "chat_groups",
+ "tableTo": "session_groups",
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
- },
- "channel_messages_thread_fk": {
- "name": "channel_messages_thread_fk",
- "tableFrom": "channel_messages",
- "tableTo": "channel_threads",
- "columnsFrom": [
- "channel_id",
- "thread_id"
- ],
- "columnsTo": [
- "channel_id",
- "id"
- ],
- "onDelete": "no action",
- "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
- "uniqueConstraints": {
- "channel_messages_scope_unique": {
- "name": "channel_messages_scope_unique",
- "nullsNotDistinct": false,
- "columns": [
- "channel_id",
- "id"
- ]
- }
- },
+ "uniqueConstraints": {},
"policies": {},
- "checkConstraints": {
- "channel_messages_sender_check": {
- "name": "channel_messages_sender_check",
- "value": "\"channel_messages\".\"user_id\" IS NULL OR \"channel_messages\".\"agent_id\" IS NULL"
- },
- "channel_messages_user_sender_check": {
- "name": "channel_messages_user_sender_check",
- "value": "\"channel_messages\".\"routing_status\" <> 'reply' OR \"channel_messages\".\"user_id\" IS NULL"
- },
- "channel_messages_agent_sender_check": {
- "name": "channel_messages_agent_sender_check",
- "value": "\"channel_messages\".\"routing_status\" = 'reply' OR \"channel_messages\".\"agent_id\" IS NULL"
- }
- },
+ "checkConstraints": {},
"isRLSEnabled": false
},
- "public.channel_threads": {
- "name": "channel_threads",
+ "public.chat_groups_agents": {
+ "name": "chat_groups_agents",
"schema": "",
"columns": {
- "id": {
- "name": "id",
+ "chat_group_id": {
+ "name": "chat_group_id",
"type": "text",
- "primaryKey": true,
+ "primaryKey": false,
"notNull": true
},
- "channel_id": {
- "name": "channel_id",
+ "agent_id": {
+ "name": "agent_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "root_message_id": {
- "name": "root_message_id",
- "type": "uuid",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "root_sequence": {
- "name": "root_sequence",
- "type": "integer",
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "follower_member_ids": {
- "name": "follower_member_ids",
- "type": "jsonb",
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
"primaryKey": false,
- "notNull": true,
- "default": "'[]'::jsonb"
+ "notNull": false,
+ "default": true
},
- "status": {
- "name": "status",
- "type": "text",
+ "order": {
+ "name": "order",
+ "type": "integer",
"primaryKey": false,
- "notNull": true,
- "default": "'active'"
+ "notNull": false,
+ "default": 0
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
+ "role": {
+ "name": "role",
+ "type": "text",
"primaryKey": false,
"notNull": false,
- "default": "'{}'::jsonb"
+ "default": "'participant'"
},
- "deleted_at": {
- "name": "deleted_at",
+ "accessed_at": {
+ "name": "accessed_at",
"type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "boolean",
- "primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -13298,92 +15734,118 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "channel_threads_root_unique": {
- "name": "channel_threads_root_unique",
+ "chat_groups_agents_user_id_idx": {
+ "name": "chat_groups_agents_user_id_idx",
"columns": [
{
- "expression": "channel_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_groups_agents_workspace_id_idx": {
+ "name": "chat_groups_agents_workspace_id_idx",
+ "columns": [
{
- "expression": "root_message_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"channel_threads\".\"is_deleted\" IS NOT TRUE",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "channel_threads_channel_id_channels_id_fk": {
- "name": "channel_threads_channel_id_channels_id_fk",
- "tableFrom": "channel_threads",
- "tableTo": "channels",
- "columnsFrom": [
- "channel_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "chat_groups_agents_chat_group_id_chat_groups_id_fk": {
+ "name": "chat_groups_agents_chat_group_id_chat_groups_id_fk",
+ "tableFrom": "chat_groups_agents",
+ "tableTo": "chat_groups",
+ "columnsFrom": ["chat_group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "channel_threads_root_fk": {
- "name": "channel_threads_root_fk",
- "tableFrom": "channel_threads",
- "tableTo": "channel_messages",
- "columnsFrom": [
- "channel_id",
- "root_message_id"
- ],
- "columnsTo": [
- "channel_id",
- "id"
- ],
- "onDelete": "no action",
+ "chat_groups_agents_agent_id_agents_id_fk": {
+ "name": "chat_groups_agents_agent_id_agents_id_fk",
+ "tableFrom": "chat_groups_agents",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_groups_agents_user_id_users_id_fk": {
+ "name": "chat_groups_agents_user_id_users_id_fk",
+ "tableFrom": "chat_groups_agents",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "chat_groups_agents_workspace_id_workspaces_id_fk": {
+ "name": "chat_groups_agents_workspace_id_workspaces_id_fk",
+ "tableFrom": "chat_groups_agents",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
"onUpdate": "no action"
}
},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {
- "channel_threads_scope_unique": {
- "name": "channel_threads_scope_unique",
- "nullsNotDistinct": false,
- "columns": [
- "channel_id",
- "id"
- ]
+ "compositePrimaryKeys": {
+ "chat_groups_agents_chat_group_id_agent_id_pk": {
+ "name": "chat_groups_agents_chat_group_id_agent_id_pk",
+ "columns": ["chat_group_id", "agent_id"]
}
},
+ "uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.channels": {
- "name": "channels",
+ "public.user_connector_tools": {
+ "name": "user_connector_tools",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_connector_id": {
+ "name": "user_connector_id",
+ "type": "uuid",
+ "primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
"workspace_id": {
"name": "workspace_id",
@@ -13391,69 +15853,85 @@
"primaryKey": false,
"notNull": false
},
- "project_id": {
- "name": "project_id",
- "type": "text",
+ "tool_name": {
+ "name": "tool_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
- "agent_id": {
- "name": "agent_id",
+ "description": {
+ "name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "title": {
- "name": "title",
+ "input_schema": {
+ "name": "input_schema",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "output_schema": {
+ "name": "output_schema",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "crud_type": {
+ "name": "crud_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "sequence": {
- "name": "sequence",
- "type": "integer",
+ "render_config": {
+ "name": "render_config",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": false
},
- "status": {
- "name": "status",
+ "permission": {
+ "name": "permission",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'active'"
+ "notNull": true
},
- "visibility": {
- "name": "visibility",
- "type": "text",
+ "is_work_artifact": {
+ "name": "is_work_artifact",
+ "type": "boolean",
"primaryKey": false,
"notNull": true,
- "default": "'private'"
+ "default": false
},
- "config": {
- "name": "config",
+ "work_artifact_config": {
+ "name": "work_artifact_config",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "metadata": {
- "name": "metadata",
+ "limit_config": {
+ "name": "limit_config",
"type": "jsonb",
"primaryKey": false,
- "notNull": false,
- "default": "'{}'::jsonb"
+ "notNull": false
},
- "deleted_at": {
- "name": "deleted_at",
- "type": "timestamp with time zone",
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "is_deleted": {
- "name": "is_deleted",
- "type": "boolean",
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -13471,79 +15949,65 @@
}
},
"indexes": {
- "channels_user_id_idx": {
- "name": "channels_user_id_idx",
+ "user_connector_tools_connector_tool_unique": {
+ "name": "user_connector_tools_connector_tool_unique",
"columns": [
{
- "expression": "user_id",
+ "expression": "user_connector_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "tool_name",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
},
- "channels_direct_unique": {
- "name": "channels_direct_unique",
+ "user_connector_tools_user_id_idx": {
+ "name": "user_connector_tools_user_id_idx",
"columns": [
- {
- "expression": "agent_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
- {
- "expression": "coalesce(\"workspace_id\", '')",
- "asc": true,
- "isExpression": true,
- "nulls": "last"
}
],
- "isUnique": true,
- "where": "\"channels\".\"agent_id\" IS NOT NULL",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "channels_project_id_idx": {
- "name": "channels_project_id_idx",
+ "user_connector_tools_connector_id_idx": {
+ "name": "user_connector_tools_connector_id_idx",
"columns": [
{
- "expression": "project_id",
+ "expression": "user_connector_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"channels\".\"project_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "channels_workspace_visibility_idx": {
- "name": "channels_workspace_visibility_idx",
+ "user_connector_tools_workspace_id_idx": {
+ "name": "user_connector_tools_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
- {
- "expression": "visibility",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
}
],
"isUnique": false,
@@ -13553,55 +16017,30 @@
}
},
"foreignKeys": {
- "channels_user_id_users_id_fk": {
- "name": "channels_user_id_users_id_fk",
- "tableFrom": "channels",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "channels_workspace_id_workspaces_id_fk": {
- "name": "channels_workspace_id_workspaces_id_fk",
- "tableFrom": "channels",
- "tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "user_connector_tools_user_connector_id_user_connectors_id_fk": {
+ "name": "user_connector_tools_user_connector_id_user_connectors_id_fk",
+ "tableFrom": "user_connector_tools",
+ "tableTo": "user_connectors",
+ "columnsFrom": ["user_connector_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "channels_project_id_projects_id_fk": {
- "name": "channels_project_id_projects_id_fk",
- "tableFrom": "channels",
- "tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
+ "user_connector_tools_user_id_users_id_fk": {
+ "name": "user_connector_tools_user_id_users_id_fk",
+ "tableFrom": "user_connector_tools",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "channels_agent_id_agents_id_fk": {
- "name": "channels_agent_id_agents_id_fk",
- "tableFrom": "channels",
- "tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "user_connector_tools_workspace_id_workspaces_id_fk": {
+ "name": "user_connector_tools_workspace_id_workspaces_id_fk",
+ "tableFrom": "user_connector_tools",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -13609,102 +16048,110 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
- "checkConstraints": {
- "channels_direct_visibility_check": {
- "name": "channels_direct_visibility_check",
- "value": "\"channels\".\"agent_id\" IS NULL OR \"channels\".\"visibility\" = 'private'"
- }
- },
+ "checkConstraints": {},
"isRLSEnabled": false
},
- "public.chat_groups": {
- "name": "chat_groups",
+ "public.user_connectors": {
+ "name": "user_connectors",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
- "notNull": true
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
- "title": {
- "name": "title",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "description": {
- "name": "description",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "avatar": {
- "name": "avatar",
+ "agent_id": {
+ "name": "agent_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "background_color": {
- "name": "background_color",
- "type": "text",
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "market_identifier": {
- "name": "market_identifier",
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_type": {
+ "name": "source_type",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "content": {
- "name": "content",
+ "mcp_server_url": {
+ "name": "mcp_server_url",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "editor_data": {
- "name": "editor_data",
- "type": "jsonb",
+ "mcp_connection_type": {
+ "name": "mcp_connection_type",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "config": {
- "name": "config",
+ "mcp_stdio_config": {
+ "name": "mcp_stdio_config",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "client_id": {
- "name": "client_id",
+ "status": {
+ "name": "status",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "is_enabled": {
+ "name": "is_enabled",
+ "type": "boolean",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": true
},
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
+ "oidc_config": {
+ "name": "oidc_config",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "group_id": {
- "name": "group_id",
+ "credentials": {
+ "name": "credentials",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "pinned": {
- "name": "pinned",
- "type": "boolean",
+ "token_expires_at": {
+ "name": "token_expires_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false,
- "default": false
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
},
"visibility": {
"name": "visibility",
@@ -13713,18 +16160,6 @@
"notNull": true,
"default": "'public'"
},
- "deleted_at": {
- "name": "deleted_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "boolean",
- "primaryKey": false,
- "notNull": false
- },
"accessed_at": {
"name": "accessed_at",
"type": "timestamp with time zone",
@@ -13748,47 +16183,83 @@
}
},
"indexes": {
- "chat_groups_client_id_user_id_unique": {
- "name": "chat_groups_client_id_user_id_unique",
+ "user_connectors_personal_identifier_idx": {
+ "name": "user_connectors_personal_identifier_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"user_connectors\".\"workspace_id\" IS NULL AND \"user_connectors\".\"agent_id\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_connectors_workspace_identifier_idx": {
+ "name": "user_connectors_workspace_identifier_idx",
"columns": [
{
- "expression": "client_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "user_id",
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "identifier",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
+ "where": "\"user_connectors\".\"workspace_id\" IS NOT NULL AND \"user_connectors\".\"agent_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "chat_groups_user_id_idx": {
- "name": "chat_groups_user_id_idx",
+ "user_connectors_agent_identifier_idx": {
+ "name": "user_connectors_agent_identifier_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "agent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "identifier",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"user_connectors\".\"agent_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "chat_groups_group_id_idx": {
- "name": "chat_groups_group_id_idx",
+ "user_connectors_user_id_idx": {
+ "name": "user_connectors_user_id_idx",
"columns": [
{
- "expression": "group_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -13799,11 +16270,11 @@
"method": "btree",
"with": {}
},
- "chat_groups_workspace_id_idx": {
- "name": "chat_groups_workspace_id_idx",
+ "user_connectors_token_expires_at_idx": {
+ "name": "user_connectors_token_expires_at_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "token_expires_at",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -13814,23 +16285,26 @@
"method": "btree",
"with": {}
},
- "chat_groups_workspace_visibility_idx": {
- "name": "chat_groups_workspace_visibility_idx",
+ "user_connectors_workspace_id_idx": {
+ "name": "user_connectors_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
- {
- "expression": "visibility",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_connectors_agent_id_idx": {
+ "name": "user_connectors_agent_id_idx",
+ "columns": [
{
- "expression": "user_id",
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -13843,43 +16317,31 @@
}
},
"foreignKeys": {
- "chat_groups_user_id_users_id_fk": {
- "name": "chat_groups_user_id_users_id_fk",
- "tableFrom": "chat_groups",
+ "user_connectors_user_id_users_id_fk": {
+ "name": "user_connectors_user_id_users_id_fk",
+ "tableFrom": "user_connectors",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "chat_groups_workspace_id_workspaces_id_fk": {
- "name": "chat_groups_workspace_id_workspaces_id_fk",
- "tableFrom": "chat_groups",
+ "user_connectors_workspace_id_workspaces_id_fk": {
+ "name": "user_connectors_workspace_id_workspaces_id_fk",
+ "tableFrom": "user_connectors",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "chat_groups_group_id_session_groups_id_fk": {
- "name": "chat_groups_group_id_session_groups_id_fk",
- "tableFrom": "chat_groups",
- "tableTo": "session_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
+ "user_connectors_agent_id_agents_id_fk": {
+ "name": "user_connectors_agent_id_agents_id_fk",
+ "tableFrom": "user_connectors",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
"onUpdate": "no action"
}
},
@@ -13889,54 +16351,57 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.chat_groups_agents": {
- "name": "chat_groups_agents",
+ "public.user_installed_plugins": {
+ "name": "user_installed_plugins",
"schema": "",
"columns": {
- "chat_group_id": {
- "name": "chat_group_id",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "agent_id": {
- "name": "agent_id",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "user_id": {
- "name": "user_id",
+ "identifier": {
+ "name": "identifier",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "type": {
+ "name": "type",
"type": "text",
"primaryKey": false,
+ "notNull": true
+ },
+ "manifest": {
+ "name": "manifest",
+ "type": "jsonb",
+ "primaryKey": false,
"notNull": false
},
- "enabled": {
- "name": "enabled",
- "type": "boolean",
+ "settings": {
+ "name": "settings",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": false,
- "default": true
+ "notNull": false
},
- "order": {
- "name": "order",
- "type": "integer",
+ "custom_params": {
+ "name": "custom_params",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": false,
- "default": 0
+ "notNull": false
},
- "role": {
- "name": "role",
- "type": "text",
+ "source": {
+ "name": "source",
+ "type": "varchar(255)",
"primaryKey": false,
- "notNull": false,
- "default": "'participant'"
+ "notNull": false
},
"accessed_at": {
"name": "accessed_at",
@@ -13961,23 +16426,8 @@
}
},
"indexes": {
- "chat_groups_agents_user_id_idx": {
- "name": "chat_groups_agents_user_id_idx",
- "columns": [
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "chat_groups_agents_workspace_id_idx": {
- "name": "chat_groups_agents_workspace_id_idx",
+ "user_installed_plugins_workspace_id_idx": {
+ "name": "user_installed_plugins_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -13993,66 +16443,29 @@
}
},
"foreignKeys": {
- "chat_groups_agents_chat_group_id_chat_groups_id_fk": {
- "name": "chat_groups_agents_chat_group_id_chat_groups_id_fk",
- "tableFrom": "chat_groups_agents",
- "tableTo": "chat_groups",
- "columnsFrom": [
- "chat_group_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "chat_groups_agents_agent_id_agents_id_fk": {
- "name": "chat_groups_agents_agent_id_agents_id_fk",
- "tableFrom": "chat_groups_agents",
- "tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "chat_groups_agents_user_id_users_id_fk": {
- "name": "chat_groups_agents_user_id_users_id_fk",
- "tableFrom": "chat_groups_agents",
+ "user_installed_plugins_user_id_users_id_fk": {
+ "name": "user_installed_plugins_user_id_users_id_fk",
+ "tableFrom": "user_installed_plugins",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "chat_groups_agents_workspace_id_workspaces_id_fk": {
- "name": "chat_groups_agents_workspace_id_workspaces_id_fk",
- "tableFrom": "chat_groups_agents",
+ "user_installed_plugins_workspace_id_workspaces_id_fk": {
+ "name": "user_installed_plugins_workspace_id_workspaces_id_fk",
+ "tableFrom": "user_installed_plugins",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {
- "chat_groups_agents_chat_group_id_agent_id_pk": {
- "name": "chat_groups_agents_chat_group_id_agent_id_pk",
- "columns": [
- "chat_group_id",
- "agent_id"
- ]
+ "user_installed_plugins_user_id_identifier_pk": {
+ "name": "user_installed_plugins_user_id_identifier_pk",
+ "columns": ["user_id", "identifier"]
}
},
"uniqueConstraints": {},
@@ -14060,8 +16473,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.user_connector_tools": {
- "name": "user_connector_tools",
+ "public.user_contact_requests": {
+ "name": "user_contact_requests",
"schema": "",
"columns": {
"id": {
@@ -14071,14 +16484,14 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "user_connector_id": {
- "name": "user_connector_id",
- "type": "uuid",
+ "requester_id": {
+ "name": "requester_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "user_id": {
- "name": "user_id",
+ "addressee_id": {
+ "name": "addressee_id",
"type": "text",
"primaryKey": false,
"notNull": true
@@ -14089,76 +16502,22 @@
"primaryKey": false,
"notNull": false
},
- "tool_name": {
- "name": "tool_name",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true
- },
- "display_name": {
- "name": "display_name",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "input_schema": {
- "name": "input_schema",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "output_schema": {
- "name": "output_schema",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "crud_type": {
- "name": "crud_type",
+ "message": {
+ "name": "message",
"type": "text",
"primaryKey": false,
- "notNull": true
- },
- "render_config": {
- "name": "render_config",
- "type": "jsonb",
- "primaryKey": false,
"notNull": false
},
- "permission": {
- "name": "permission",
+ "status": {
+ "name": "status",
"type": "text",
"primaryKey": false,
- "notNull": true
- },
- "is_work_artifact": {
- "name": "is_work_artifact",
- "type": "boolean",
- "primaryKey": false,
"notNull": true,
- "default": false
- },
- "work_artifact_config": {
- "name": "work_artifact_config",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "limit_config": {
- "name": "limit_config",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
+ "default": "'pending'"
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
+ "responded_at": {
+ "name": "responded_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
@@ -14185,32 +16544,67 @@
}
},
"indexes": {
- "user_connector_tools_connector_tool_unique": {
- "name": "user_connector_tools_connector_tool_unique",
+ "user_contact_requests_pending_unique": {
+ "name": "user_contact_requests_pending_unique",
"columns": [
{
- "expression": "user_connector_id",
+ "expression": "requester_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "tool_name",
+ "expression": "addressee_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
+ "where": "\"user_contact_requests\".\"status\" = 'pending' AND \"user_contact_requests\".\"workspace_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "user_connector_tools_user_id_idx": {
- "name": "user_connector_tools_user_id_idx",
+ "user_contact_requests_workspace_pending_unique": {
+ "name": "user_contact_requests_workspace_pending_unique",
"columns": [
{
- "expression": "user_id",
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "requester_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "addressee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"user_contact_requests\".\"status\" = 'pending' AND \"user_contact_requests\".\"workspace_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_contact_requests_addressee_status_idx": {
+ "name": "user_contact_requests_addressee_status_idx",
+ "columns": [
+ {
+ "expression": "addressee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -14221,11 +16615,17 @@
"method": "btree",
"with": {}
},
- "user_connector_tools_connector_id_idx": {
- "name": "user_connector_tools_connector_id_idx",
+ "user_contact_requests_requester_status_idx": {
+ "name": "user_contact_requests_requester_status_idx",
"columns": [
{
- "expression": "user_connector_id",
+ "expression": "requester_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -14236,8 +16636,8 @@
"method": "btree",
"with": {}
},
- "user_connector_tools_workspace_id_idx": {
- "name": "user_connector_tools_workspace_id_idx",
+ "user_contact_requests_workspace_id_idx": {
+ "name": "user_contact_requests_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -14253,42 +16653,30 @@
}
},
"foreignKeys": {
- "user_connector_tools_user_connector_id_user_connectors_id_fk": {
- "name": "user_connector_tools_user_connector_id_user_connectors_id_fk",
- "tableFrom": "user_connector_tools",
- "tableTo": "user_connectors",
- "columnsFrom": [
- "user_connector_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "user_contact_requests_requester_id_users_id_fk": {
+ "name": "user_contact_requests_requester_id_users_id_fk",
+ "tableFrom": "user_contact_requests",
+ "tableTo": "users",
+ "columnsFrom": ["requester_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "user_connector_tools_user_id_users_id_fk": {
- "name": "user_connector_tools_user_id_users_id_fk",
- "tableFrom": "user_connector_tools",
+ "user_contact_requests_addressee_id_users_id_fk": {
+ "name": "user_contact_requests_addressee_id_users_id_fk",
+ "tableFrom": "user_contact_requests",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["addressee_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "user_connector_tools_workspace_id_workspaces_id_fk": {
- "name": "user_connector_tools_workspace_id_workspaces_id_fk",
- "tableFrom": "user_connector_tools",
+ "user_contact_requests_workspace_id_workspaces_id_fk": {
+ "name": "user_contact_requests_workspace_id_workspaces_id_fk",
+ "tableFrom": "user_contact_requests",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -14296,11 +16684,16 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
- "checkConstraints": {},
+ "checkConstraints": {
+ "user_contact_requests_not_self_check": {
+ "name": "user_contact_requests_not_self_check",
+ "value": "\"user_contact_requests\".\"requester_id\" <> \"user_contact_requests\".\"addressee_id\""
+ }
+ },
"isRLSEnabled": false
},
- "public.user_connectors": {
- "name": "user_connectors",
+ "public.user_contact_tag_assignments": {
+ "name": "user_contact_tag_assignments",
"schema": "",
"columns": {
"id": {
@@ -14310,96 +16703,169 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "tag_id": {
+ "name": "tag_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
+ "contact_id": {
+ "name": "contact_id",
+ "type": "uuid",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "agent_id": {
- "name": "agent_id",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "identifier": {
- "name": "identifier",
- "type": "varchar(255)",
- "primaryKey": false,
"notNull": true
},
- "name": {
- "name": "name",
- "type": "varchar(255)",
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "now()"
},
- "source_type": {
- "name": "source_type",
- "type": "text",
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "now()"
},
- "mcp_server_url": {
- "name": "mcp_server_url",
- "type": "text",
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_contact_tag_assignments_tag_id_contact_id_unique": {
+ "name": "user_contact_tag_assignments_tag_id_contact_id_unique",
+ "columns": [
+ {
+ "expression": "tag_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "contact_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
},
- "mcp_connection_type": {
- "name": "mcp_connection_type",
- "type": "text",
- "primaryKey": false,
- "notNull": false
+ "user_contact_tag_assignments_contact_id_idx": {
+ "name": "user_contact_tag_assignments_contact_id_idx",
+ "columns": [
+ {
+ "expression": "contact_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
},
- "mcp_stdio_config": {
- "name": "mcp_stdio_config",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
+ "user_contact_tag_assignments_user_id_idx": {
+ "name": "user_contact_tag_assignments_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_contact_tag_assignments_tag_id_user_contact_tags_id_fk": {
+ "name": "user_contact_tag_assignments_tag_id_user_contact_tags_id_fk",
+ "tableFrom": "user_contact_tag_assignments",
+ "tableTo": "user_contact_tags",
+ "columnsFrom": ["tag_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
},
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true
+ "user_contact_tag_assignments_contact_id_user_contacts_id_fk": {
+ "name": "user_contact_tag_assignments_contact_id_user_contacts_id_fk",
+ "tableFrom": "user_contact_tag_assignments",
+ "tableTo": "user_contacts",
+ "columnsFrom": ["contact_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
},
- "is_enabled": {
- "name": "is_enabled",
- "type": "boolean",
- "primaryKey": false,
+ "user_contact_tag_assignments_user_id_users_id_fk": {
+ "name": "user_contact_tag_assignments_user_id_users_id_fk",
+ "tableFrom": "user_contact_tag_assignments",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_contact_tags": {
+ "name": "user_contact_tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
"notNull": true,
- "default": true
+ "default": "gen_random_uuid()"
},
- "oidc_config": {
- "name": "oidc_config",
- "type": "jsonb",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "credentials": {
- "name": "credentials",
+ "name": {
+ "name": "name",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "token_expires_at": {
- "name": "token_expires_at",
- "type": "timestamp with time zone",
+ "color": {
+ "name": "color",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": 0
},
"accessed_at": {
"name": "accessed_at",
@@ -14424,8 +16890,8 @@
}
},
"indexes": {
- "user_connectors_personal_identifier_idx": {
- "name": "user_connectors_personal_identifier_idx",
+ "user_contact_tags_user_id_name_unique": {
+ "name": "user_contact_tags_user_id_name_unique",
"columns": [
{
"expression": "user_id",
@@ -14434,20 +16900,125 @@
"nulls": "last"
},
{
- "expression": "identifier",
+ "expression": "name",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
- "where": "\"user_connectors\".\"workspace_id\" IS NULL AND \"user_connectors\".\"agent_id\" IS NULL",
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_contact_tags_user_id_users_id_fk": {
+ "name": "user_contact_tags_user_id_users_id_fk",
+ "tableFrom": "user_contact_tags",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_contacts": {
+ "name": "user_contacts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
- "user_connectors_workspace_identifier_idx": {
- "name": "user_connectors_workspace_identifier_idx",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_user_id": {
+ "name": "contact_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_id": {
+ "name": "agent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "phones": {
+ "name": "phones",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_contacts_user_unique": {
+ "name": "user_contacts_user_unique",
"columns": [
{
"expression": "user_id",
@@ -14456,81 +17027,95 @@
"nulls": "last"
},
{
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "identifier",
+ "expression": "contact_user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
- "where": "\"user_connectors\".\"workspace_id\" IS NOT NULL AND \"user_connectors\".\"agent_id\" IS NULL",
+ "isUnique": true,
+ "where": "\"user_contacts\".\"contact_user_id\" IS NOT NULL AND \"user_contacts\".\"workspace_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "user_connectors_agent_identifier_idx": {
- "name": "user_connectors_agent_identifier_idx",
+ "user_contacts_workspace_user_unique": {
+ "name": "user_contacts_workspace_user_unique",
"columns": [
{
- "expression": "agent_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "identifier",
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "contact_user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
- "where": "\"user_connectors\".\"agent_id\" IS NOT NULL",
+ "isUnique": true,
+ "where": "\"user_contacts\".\"contact_user_id\" IS NOT NULL AND \"user_contacts\".\"workspace_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "user_connectors_user_id_idx": {
- "name": "user_connectors_user_id_idx",
+ "user_contacts_agent_unique": {
+ "name": "user_contacts_agent_unique",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
+ },
+ {
+ "expression": "agent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"user_contacts\".\"agent_id\" IS NOT NULL AND \"user_contacts\".\"workspace_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "user_connectors_token_expires_at_idx": {
- "name": "user_connectors_token_expires_at_idx",
+ "user_contacts_workspace_agent_unique": {
+ "name": "user_contacts_workspace_agent_unique",
"columns": [
{
- "expression": "token_expires_at",
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"user_contacts\".\"agent_id\" IS NOT NULL AND \"user_contacts\".\"workspace_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "user_connectors_workspace_id_idx": {
- "name": "user_connectors_workspace_id_idx",
+ "user_contacts_contact_user_id_idx": {
+ "name": "user_contacts_contact_user_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "contact_user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -14541,8 +17126,8 @@
"method": "btree",
"with": {}
},
- "user_connectors_agent_id_idx": {
- "name": "user_connectors_agent_id_idx",
+ "user_contacts_agent_id_idx": {
+ "name": "user_contacts_agent_id_idx",
"columns": [
{
"expression": "agent_id",
@@ -14555,132 +17140,9 @@
"concurrently": false,
"method": "btree",
"with": {}
- }
- },
- "foreignKeys": {
- "user_connectors_user_id_users_id_fk": {
- "name": "user_connectors_user_id_users_id_fk",
- "tableFrom": "user_connectors",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "user_connectors_workspace_id_workspaces_id_fk": {
- "name": "user_connectors_workspace_id_workspaces_id_fk",
- "tableFrom": "user_connectors",
- "tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "user_connectors_agent_id_agents_id_fk": {
- "name": "user_connectors_agent_id_agents_id_fk",
- "tableFrom": "user_connectors",
- "tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.user_installed_plugins": {
- "name": "user_installed_plugins",
- "schema": "",
- "columns": {
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "type": {
- "name": "type",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "manifest": {
- "name": "manifest",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "settings": {
- "name": "settings",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "custom_params": {
- "name": "custom_params",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "source": {
- "name": "source",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false
- },
- "accessed_at": {
- "name": "accessed_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
- },
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
- }
- },
- "indexes": {
- "user_installed_plugins_workspace_id_idx": {
- "name": "user_installed_plugins_workspace_id_idx",
+ "user_contacts_workspace_id_idx": {
+ "name": "user_contacts_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -14696,42 +17158,44 @@
}
},
"foreignKeys": {
- "user_installed_plugins_user_id_users_id_fk": {
- "name": "user_installed_plugins_user_id_users_id_fk",
- "tableFrom": "user_installed_plugins",
+ "user_contacts_user_id_users_id_fk": {
+ "name": "user_contacts_user_id_users_id_fk",
+ "tableFrom": "user_contacts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "user_installed_plugins_workspace_id_workspaces_id_fk": {
- "name": "user_installed_plugins_workspace_id_workspaces_id_fk",
- "tableFrom": "user_installed_plugins",
+ "user_contacts_workspace_id_workspaces_id_fk": {
+ "name": "user_contacts_workspace_id_workspaces_id_fk",
+ "tableFrom": "user_contacts",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_contacts_contact_user_id_users_id_fk": {
+ "name": "user_contacts_contact_user_id_users_id_fk",
+ "tableFrom": "user_contacts",
+ "tableTo": "users",
+ "columnsFrom": ["contact_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_contacts_agent_id_agents_id_fk": {
+ "name": "user_contacts_agent_id_agents_id_fk",
+ "tableFrom": "user_contacts",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
- "compositePrimaryKeys": {
- "user_installed_plugins_user_id_identifier_pk": {
- "name": "user_installed_plugins_user_id_identifier_pk",
- "columns": [
- "user_id",
- "identifier"
- ]
- }
- },
+ "compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
@@ -14901,12 +17365,8 @@
"name": "dashboard_items_dashboard_id_dashboards_id_fk",
"tableFrom": "dashboard_items",
"tableTo": "dashboards",
- "columnsFrom": [
- "dashboard_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dashboard_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -14914,12 +17374,8 @@
"name": "dashboard_items_widget_id_widgets_id_fk",
"tableFrom": "dashboard_items",
"tableTo": "widgets",
- "columnsFrom": [
- "widget_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["widget_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -14927,12 +17383,8 @@
"name": "dashboard_items_user_id_users_id_fk",
"tableFrom": "dashboard_items",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -14940,12 +17392,8 @@
"name": "dashboard_items_workspace_id_workspaces_id_fk",
"tableFrom": "dashboard_items",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15188,12 +17636,8 @@
"name": "dashboards_user_id_users_id_fk",
"tableFrom": "dashboards",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15201,12 +17645,8 @@
"name": "dashboards_workspace_id_workspaces_id_fk",
"tableFrom": "dashboards",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15214,12 +17654,8 @@
"name": "dashboards_project_id_projects_id_fk",
"tableFrom": "dashboards",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15227,12 +17663,8 @@
"name": "dashboards_agent_id_agents_id_fk",
"tableFrom": "dashboards",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15485,12 +17917,8 @@
"name": "devices_user_id_users_id_fk",
"tableFrom": "devices",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15498,12 +17926,8 @@
"name": "devices_workspace_id_workspaces_id_fk",
"tableFrom": "devices",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15615,12 +18039,8 @@
"name": "document_comment_mentions_comment_id_document_comments_id_fk",
"tableFrom": "document_comment_mentions",
"tableTo": "document_comments",
- "columnsFrom": [
- "comment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["comment_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15628,12 +18048,8 @@
"name": "document_comment_mentions_mentioned_user_id_users_id_fk",
"tableFrom": "document_comment_mentions",
"tableTo": "users",
- "columnsFrom": [
- "mentioned_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["mentioned_user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15641,12 +18057,8 @@
"name": "document_comment_mentions_workspace_id_workspaces_id_fk",
"tableFrom": "document_comment_mentions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15876,12 +18288,8 @@
"name": "document_comments_document_id_documents_id_fk",
"tableFrom": "document_comments",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15889,12 +18297,8 @@
"name": "document_comments_parent_comment_id_document_comments_id_fk",
"tableFrom": "document_comments",
"tableTo": "document_comments",
- "columnsFrom": [
- "parent_comment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_comment_id"],
+ "columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
},
@@ -15902,12 +18306,8 @@
"name": "document_comments_reply_to_comment_id_document_comments_id_fk",
"tableFrom": "document_comments",
"tableTo": "document_comments",
- "columnsFrom": [
- "reply_to_comment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["reply_to_comment_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -15915,12 +18315,8 @@
"name": "document_comments_author_user_id_users_id_fk",
"tableFrom": "document_comments",
"tableTo": "users",
- "columnsFrom": [
- "author_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["author_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -15928,12 +18324,8 @@
"name": "document_comments_workspace_id_workspaces_id_fk",
"tableFrom": "document_comments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -16081,12 +18473,8 @@
"name": "document_histories_document_id_documents_id_fk",
"tableFrom": "document_histories",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16094,12 +18482,8 @@
"name": "document_histories_user_id_users_id_fk",
"tableFrom": "document_histories",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16107,12 +18491,8 @@
"name": "document_histories_workspace_id_workspaces_id_fk",
"tableFrom": "document_histories",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -16239,12 +18619,8 @@
"name": "document_likes_document_id_documents_id_fk",
"tableFrom": "document_likes",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16252,12 +18628,8 @@
"name": "document_likes_user_id_users_id_fk",
"tableFrom": "document_likes",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16265,12 +18637,8 @@
"name": "document_likes_workspace_id_workspaces_id_fk",
"tableFrom": "document_likes",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -16405,12 +18773,8 @@
"name": "document_shares_document_id_documents_id_fk",
"tableFrom": "document_shares",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16418,12 +18782,8 @@
"name": "document_shares_user_id_users_id_fk",
"tableFrom": "document_shares",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16431,12 +18791,8 @@
"name": "document_shares_workspace_id_workspaces_id_fk",
"tableFrom": "document_shares",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -16470,6 +18826,12 @@
"primaryKey": false,
"notNull": false
},
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
"name": {
"name": "name",
"type": "varchar(255)",
@@ -16555,6 +18917,22 @@
"method": "btree",
"with": {}
},
+ "environments_project_id_unique": {
+ "name": "environments_project_id_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"environments\".\"project_id\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
"environments_workspace_visibility_idx": {
"name": "environments_workspace_visibility_idx",
"columns": [
@@ -16599,7 +18977,7 @@
}
],
"isUnique": true,
- "where": "\"environments\".\"workspace_id\" is null",
+ "where": "\"environments\".\"workspace_id\" IS NULL AND \"environments\".\"project_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
@@ -16627,7 +19005,7 @@
}
],
"isUnique": true,
- "where": "\"environments\".\"workspace_id\" is not null",
+ "where": "\"environments\".\"workspace_id\" IS NOT NULL AND \"environments\".\"project_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
@@ -16638,12 +19016,8 @@
"name": "environments_user_id_users_id_fk",
"tableFrom": "environments",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "restrict",
"onUpdate": "no action"
},
@@ -16651,12 +19025,17 @@
"name": "environments_workspace_id_workspaces_id_fk",
"tableFrom": "environments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "environments_project_id_projects_id_fk": {
+ "name": "environments_project_id_projects_id_fk",
+ "tableFrom": "environments",
+ "tableTo": "projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "restrict",
"onUpdate": "no action"
}
@@ -16900,12 +19279,8 @@
"name": "environment_instances_environment_id_environments_id_fk",
"tableFrom": "environment_instances",
"tableTo": "environments",
- "columnsFrom": [
- "environment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["environment_id"],
+ "columnsTo": ["id"],
"onDelete": "restrict",
"onUpdate": "no action"
},
@@ -16913,12 +19288,8 @@
"name": "environment_instances_device_id_devices_id_fk",
"tableFrom": "environment_instances",
"tableTo": "devices",
- "columnsFrom": [
- "device_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
"onDelete": "restrict",
"onUpdate": "no action"
}
@@ -17171,12 +19542,8 @@
"name": "expertise_bindings_domain_id_expertise_domains_id_fk",
"tableFrom": "expertise_bindings",
"tableTo": "expertise_domains",
- "columnsFrom": [
- "domain_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["domain_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17184,12 +19551,8 @@
"name": "expertise_bindings_agent_id_agents_id_fk",
"tableFrom": "expertise_bindings",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17197,12 +19560,8 @@
"name": "expertise_bindings_project_id_projects_id_fk",
"tableFrom": "expertise_bindings",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17210,12 +19569,8 @@
"name": "expertise_bindings_bound_workspace_id_workspaces_id_fk",
"tableFrom": "expertise_bindings",
"tableTo": "workspaces",
- "columnsFrom": [
- "bound_workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["bound_workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17223,12 +19578,8 @@
"name": "expertise_bindings_bound_user_id_users_id_fk",
"tableFrom": "expertise_bindings",
"tableTo": "users",
- "columnsFrom": [
- "bound_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["bound_user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17236,12 +19587,8 @@
"name": "expertise_bindings_added_by_user_id_users_id_fk",
"tableFrom": "expertise_bindings",
"tableTo": "users",
- "columnsFrom": [
- "added_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["added_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -17249,12 +19596,8 @@
"name": "expertise_bindings_workspace_id_workspaces_id_fk",
"tableFrom": "expertise_bindings",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -17484,12 +19827,8 @@
"name": "expertise_domain_snapshots_domain_id_expertise_domains_id_fk",
"tableFrom": "expertise_domain_snapshots",
"tableTo": "expertise_domains",
- "columnsFrom": [
- "domain_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["domain_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17497,12 +19836,8 @@
"name": "expertise_domain_snapshots_run_id_expertise_runs_id_fk",
"tableFrom": "expertise_domain_snapshots",
"tableTo": "expertise_runs",
- "columnsFrom": [
- "run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["run_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -17510,14 +19845,8 @@
"name": "expertise_domain_snapshots_run_domain_fk",
"tableFrom": "expertise_domain_snapshots",
"tableTo": "expertise_runs",
- "columnsFrom": [
- "run_id",
- "domain_id"
- ],
- "columnsTo": [
- "id",
- "domain_id"
- ],
+ "columnsFrom": ["run_id", "domain_id"],
+ "columnsTo": ["id", "domain_id"],
"onDelete": "no action",
"onUpdate": "no action"
}
@@ -17802,12 +20131,8 @@
"name": "expertise_domains_user_id_users_id_fk",
"tableFrom": "expertise_domains",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17815,12 +20140,8 @@
"name": "expertise_domains_workspace_id_workspaces_id_fk",
"tableFrom": "expertise_domains",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17828,12 +20149,8 @@
"name": "expertise_domains_parent_domain_id_expertise_domains_id_fk",
"tableFrom": "expertise_domains",
"tableTo": "expertise_domains",
- "columnsFrom": [
- "parent_domain_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_domain_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -17841,12 +20158,8 @@
"name": "expertise_domains_canon_document_id_documents_id_fk",
"tableFrom": "expertise_domains",
"tableTo": "documents",
- "columnsFrom": [
- "canon_document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["canon_document_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -17854,12 +20167,8 @@
"name": "expertise_domains_lesson_base_document_id_documents_id_fk",
"tableFrom": "expertise_domains",
"tableTo": "documents",
- "columnsFrom": [
- "lesson_base_document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["lesson_base_document_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -17867,12 +20176,8 @@
"name": "expertise_domains_anchor_chosen_by_user_id_users_id_fk",
"tableFrom": "expertise_domains",
"tableTo": "users",
- "columnsFrom": [
- "anchor_chosen_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["anchor_chosen_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -18081,12 +20386,8 @@
"name": "expertise_hits_domain_id_expertise_domains_id_fk",
"tableFrom": "expertise_hits",
"tableTo": "expertise_domains",
- "columnsFrom": [
- "domain_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["domain_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18094,12 +20395,8 @@
"name": "expertise_hits_evidence_id_verify_evidence_id_fk",
"tableFrom": "expertise_hits",
"tableTo": "verify_evidence",
- "columnsFrom": [
- "evidence_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["evidence_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -18107,12 +20404,8 @@
"name": "expertise_hits_operation_id_agent_operations_id_fk",
"tableFrom": "expertise_hits",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -18120,12 +20413,8 @@
"name": "expertise_hits_source_check_result_id_verify_check_results_id_fk",
"tableFrom": "expertise_hits",
"tableTo": "verify_check_results",
- "columnsFrom": [
- "source_check_result_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["source_check_result_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -18133,12 +20422,8 @@
"name": "expertise_hits_source_message_id_messages_id_fk",
"tableFrom": "expertise_hits",
"tableTo": "messages",
- "columnsFrom": [
- "source_message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["source_message_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -18146,14 +20431,8 @@
"name": "expertise_hits_run_domain_fk",
"tableFrom": "expertise_hits",
"tableTo": "expertise_runs",
- "columnsFrom": [
- "run_id",
- "domain_id"
- ],
- "columnsTo": [
- "id",
- "domain_id"
- ],
+ "columnsFrom": ["run_id", "domain_id"],
+ "columnsTo": ["id", "domain_id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18161,14 +20440,8 @@
"name": "expertise_hits_lesson_domain_fk",
"tableFrom": "expertise_hits",
"tableTo": "expertise_lessons",
- "columnsFrom": [
- "lesson_id",
- "domain_id"
- ],
- "columnsTo": [
- "id",
- "domain_id"
- ],
+ "columnsFrom": ["lesson_id", "domain_id"],
+ "columnsTo": ["id", "domain_id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -18355,12 +20628,8 @@
"name": "expertise_insights_domain_id_expertise_domains_id_fk",
"tableFrom": "expertise_insights",
"tableTo": "expertise_domains",
- "columnsFrom": [
- "domain_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["domain_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18368,12 +20637,8 @@
"name": "expertise_insights_user_id_users_id_fk",
"tableFrom": "expertise_insights",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18381,12 +20646,8 @@
"name": "expertise_insights_workspace_id_workspaces_id_fk",
"tableFrom": "expertise_insights",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18394,12 +20655,8 @@
"name": "expertise_insights_generated_by_operation_id_agent_operations_id_fk",
"tableFrom": "expertise_insights",
"tableTo": "agent_operations",
- "columnsFrom": [
- "generated_by_operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["generated_by_operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -18539,12 +20796,8 @@
"name": "expertise_lesson_revisions_lesson_id_expertise_lessons_id_fk",
"tableFrom": "expertise_lesson_revisions",
"tableTo": "expertise_lessons",
- "columnsFrom": [
- "lesson_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["lesson_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18552,12 +20805,8 @@
"name": "expertise_lesson_revisions_changed_by_user_id_users_id_fk",
"tableFrom": "expertise_lesson_revisions",
"tableTo": "users",
- "columnsFrom": [
- "changed_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["changed_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -18565,12 +20814,8 @@
"name": "expertise_lesson_revisions_operation_id_agent_operations_id_fk",
"tableFrom": "expertise_lesson_revisions",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -18904,12 +21149,8 @@
"name": "expertise_lessons_domain_id_expertise_domains_id_fk",
"tableFrom": "expertise_lessons",
"tableTo": "expertise_domains",
- "columnsFrom": [
- "domain_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["domain_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18917,12 +21158,8 @@
"name": "expertise_lessons_created_by_user_id_users_id_fk",
"tableFrom": "expertise_lessons",
"tableTo": "users",
- "columnsFrom": [
- "created_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -18930,12 +21167,8 @@
"name": "expertise_lessons_salvaged_from_id_expertise_lessons_id_fk",
"tableFrom": "expertise_lessons",
"tableTo": "expertise_lessons",
- "columnsFrom": [
- "salvaged_from_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["salvaged_from_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -18943,12 +21176,8 @@
"name": "expertise_lessons_compiled_criterion_id_verify_criteria_id_fk",
"tableFrom": "expertise_lessons",
"tableTo": "verify_criteria",
- "columnsFrom": [
- "compiled_criterion_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["compiled_criterion_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -18958,10 +21187,7 @@
"expertise_lessons_id_domain_unique": {
"name": "expertise_lessons_id_domain_unique",
"nullsNotDistinct": false,
- "columns": [
- "id",
- "domain_id"
- ]
+ "columns": ["id", "domain_id"]
}
},
"policies": {},
@@ -19228,12 +21454,8 @@
"name": "expertise_runs_domain_id_expertise_domains_id_fk",
"tableFrom": "expertise_runs",
"tableTo": "expertise_domains",
- "columnsFrom": [
- "domain_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["domain_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19241,12 +21463,8 @@
"name": "expertise_runs_user_id_users_id_fk",
"tableFrom": "expertise_runs",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -19254,12 +21472,8 @@
"name": "expertise_runs_workspace_id_workspaces_id_fk",
"tableFrom": "expertise_runs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -19269,10 +21483,7 @@
"expertise_runs_id_domain_unique": {
"name": "expertise_runs_id_domain_unique",
"nullsNotDistinct": false,
- "columns": [
- "id",
- "domain_id"
- ]
+ "columns": ["id", "domain_id"]
}
},
"policies": {},
@@ -19460,12 +21671,8 @@
"name": "user_favorites_user_id_users_id_fk",
"tableFrom": "user_favorites",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19473,12 +21680,8 @@
"name": "user_favorites_workspace_id_workspaces_id_fk",
"tableFrom": "user_favorites",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -19879,12 +22082,8 @@
"name": "documents_file_id_files_id_fk",
"tableFrom": "documents",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -19892,12 +22091,8 @@
"name": "documents_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "documents",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -19905,12 +22100,8 @@
"name": "documents_parent_id_documents_id_fk",
"tableFrom": "documents",
"tableTo": "documents",
- "columnsFrom": [
- "parent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -19918,12 +22109,8 @@
"name": "documents_user_id_users_id_fk",
"tableFrom": "documents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19931,12 +22118,8 @@
"name": "documents_workspace_id_workspaces_id_fk",
"tableFrom": "documents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -20153,12 +22336,8 @@
"name": "file_uploads_user_id_users_id_fk",
"tableFrom": "file_uploads",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20166,12 +22345,8 @@
"name": "file_uploads_workspace_id_workspaces_id_fk",
"tableFrom": "file_uploads",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20179,12 +22354,8 @@
"name": "file_uploads_file_id_files_id_fk",
"tableFrom": "file_uploads",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -20469,12 +22640,8 @@
"name": "files_user_id_users_id_fk",
"tableFrom": "files",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20482,12 +22649,8 @@
"name": "files_file_hash_global_files_hash_id_fk",
"tableFrom": "files",
"tableTo": "global_files",
- "columnsFrom": [
- "file_hash"
- ],
- "columnsTo": [
- "hash_id"
- ],
+ "columnsFrom": ["file_hash"],
+ "columnsTo": ["hash_id"],
"onDelete": "no action",
"onUpdate": "no action"
},
@@ -20495,12 +22658,8 @@
"name": "files_parent_id_documents_id_fk",
"tableFrom": "files",
"tableTo": "documents",
- "columnsFrom": [
- "parent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -20508,12 +22667,8 @@
"name": "files_chunk_task_id_async_tasks_id_fk",
"tableFrom": "files",
"tableTo": "async_tasks",
- "columnsFrom": [
- "chunk_task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -20521,12 +22676,8 @@
"name": "files_embedding_task_id_async_tasks_id_fk",
"tableFrom": "files",
"tableTo": "async_tasks",
- "columnsFrom": [
- "embedding_task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["embedding_task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -20534,12 +22685,8 @@
"name": "files_workspace_id_workspaces_id_fk",
"tableFrom": "files",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -20627,12 +22774,8 @@
"name": "global_files_creator_users_id_fk",
"tableFrom": "global_files",
"tableTo": "users",
- "columnsFrom": [
- "creator"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["creator"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -20746,12 +22889,8 @@
"name": "knowledge_base_files_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "knowledge_base_files",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20759,12 +22898,8 @@
"name": "knowledge_base_files_file_id_files_id_fk",
"tableFrom": "knowledge_base_files",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20772,12 +22907,8 @@
"name": "knowledge_base_files_user_id_users_id_fk",
"tableFrom": "knowledge_base_files",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20785,12 +22916,8 @@
"name": "knowledge_base_files_workspace_id_workspaces_id_fk",
"tableFrom": "knowledge_base_files",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -20798,10 +22925,7 @@
"compositePrimaryKeys": {
"knowledge_base_files_knowledge_base_id_file_id_pk": {
"name": "knowledge_base_files_knowledge_base_id_file_id_pk",
- "columns": [
- "knowledge_base_id",
- "file_id"
- ]
+ "columns": ["knowledge_base_id", "file_id"]
}
},
"uniqueConstraints": {},
@@ -21000,12 +23124,8 @@
"name": "knowledge_bases_user_id_users_id_fk",
"tableFrom": "knowledge_bases",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21013,12 +23133,8 @@
"name": "knowledge_bases_workspace_id_workspaces_id_fk",
"tableFrom": "knowledge_bases",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -21157,12 +23273,8 @@
"name": "file_shares_file_id_files_id_fk",
"tableFrom": "file_shares",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21170,12 +23282,8 @@
"name": "file_shares_user_id_users_id_fk",
"tableFrom": "file_shares",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21183,12 +23291,8 @@
"name": "file_shares_workspace_id_workspaces_id_fk",
"tableFrom": "file_shares",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -21554,12 +23658,8 @@
"name": "generation_batches_user_id_users_id_fk",
"tableFrom": "generation_batches",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21567,12 +23667,8 @@
"name": "generation_batches_workspace_id_workspaces_id_fk",
"tableFrom": "generation_batches",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21580,12 +23676,8 @@
"name": "generation_batches_generation_topic_id_generation_topics_id_fk",
"tableFrom": "generation_batches",
"tableTo": "generation_topics",
- "columnsFrom": [
- "generation_topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["generation_topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -21742,12 +23834,8 @@
"name": "generation_topics_user_id_users_id_fk",
"tableFrom": "generation_topics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21755,12 +23843,8 @@
"name": "generation_topics_workspace_id_workspaces_id_fk",
"tableFrom": "generation_topics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -21924,12 +24008,8 @@
"name": "generations_user_id_users_id_fk",
"tableFrom": "generations",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21937,12 +24017,8 @@
"name": "generations_workspace_id_workspaces_id_fk",
"tableFrom": "generations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21950,12 +24026,8 @@
"name": "generations_generation_batch_id_generation_batches_id_fk",
"tableFrom": "generations",
"tableTo": "generation_batches",
- "columnsFrom": [
- "generation_batch_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["generation_batch_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21963,12 +24035,8 @@
"name": "generations_async_task_id_async_tasks_id_fk",
"tableFrom": "generations",
"tableTo": "async_tasks",
- "columnsFrom": [
- "async_task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["async_task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -21976,12 +24044,8 @@
"name": "generations_file_id_files_id_fk",
"tableFrom": "generations",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -22257,12 +24321,8 @@
"name": "goals_user_id_users_id_fk",
"tableFrom": "goals",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -22270,12 +24330,8 @@
"name": "goals_workspace_id_workspaces_id_fk",
"tableFrom": "goals",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -22283,12 +24339,8 @@
"name": "goals_agent_id_agents_id_fk",
"tableFrom": "goals",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -22296,12 +24348,8 @@
"name": "goals_project_id_projects_id_fk",
"tableFrom": "goals",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -22419,12 +24467,8 @@
"name": "goal_edges_goal_id_goals_id_fk",
"tableFrom": "goal_edges",
"tableTo": "goals",
- "columnsFrom": [
- "goal_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["goal_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -22432,14 +24476,8 @@
"name": "goal_edges_goal_source_node_fk",
"tableFrom": "goal_edges",
"tableTo": "goal_nodes",
- "columnsFrom": [
- "goal_id",
- "source_node_id"
- ],
- "columnsTo": [
- "goal_id",
- "id"
- ],
+ "columnsFrom": ["goal_id", "source_node_id"],
+ "columnsTo": ["goal_id", "id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -22447,14 +24485,8 @@
"name": "goal_edges_goal_target_node_fk",
"tableFrom": "goal_edges",
"tableTo": "goal_nodes",
- "columnsFrom": [
- "goal_id",
- "target_node_id"
- ],
- "columnsTo": [
- "goal_id",
- "id"
- ],
+ "columnsFrom": ["goal_id", "target_node_id"],
+ "columnsTo": ["goal_id", "id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -22622,12 +24654,8 @@
"name": "goal_events_goal_id_goals_id_fk",
"tableFrom": "goal_events",
"tableTo": "goals",
- "columnsFrom": [
- "goal_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["goal_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -22635,12 +24663,8 @@
"name": "goal_events_task_id_tasks_id_fk",
"tableFrom": "goal_events",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -22842,12 +24866,8 @@
"name": "goal_node_decisions_node_id_goal_nodes_id_fk",
"tableFrom": "goal_node_decisions",
"tableTo": "goal_nodes",
- "columnsFrom": [
- "node_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["node_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -22855,12 +24875,8 @@
"name": "goal_node_decisions_requested_user_id_users_id_fk",
"tableFrom": "goal_node_decisions",
"tableTo": "users",
- "columnsFrom": [
- "requested_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["requested_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -22868,12 +24884,8 @@
"name": "goal_node_decisions_resolved_by_user_id_users_id_fk",
"tableFrom": "goal_node_decisions",
"tableTo": "users",
- "columnsFrom": [
- "resolved_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["resolved_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -22881,12 +24893,8 @@
"name": "goal_node_decisions_resolved_by_agent_id_agents_id_fk",
"tableFrom": "goal_node_decisions",
"tableTo": "agents",
- "columnsFrom": [
- "resolved_by_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["resolved_by_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -22983,12 +24991,8 @@
"name": "goal_node_work_versions_node_id_goal_nodes_id_fk",
"tableFrom": "goal_node_work_versions",
"tableTo": "goal_nodes",
- "columnsFrom": [
- "node_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["node_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -22996,12 +25000,8 @@
"name": "goal_node_work_versions_work_version_id_work_versions_id_fk",
"tableFrom": "goal_node_work_versions",
"tableTo": "work_versions",
- "columnsFrom": [
- "work_version_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["work_version_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -23193,12 +25193,8 @@
"name": "goal_nodes_goal_id_goals_id_fk",
"tableFrom": "goal_nodes",
"tableTo": "goals",
- "columnsFrom": [
- "goal_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["goal_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23206,12 +25202,8 @@
"name": "goal_nodes_task_id_tasks_id_fk",
"tableFrom": "goal_nodes",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -23219,12 +25211,8 @@
"name": "goal_nodes_created_by_user_id_users_id_fk",
"tableFrom": "goal_nodes",
"tableTo": "users",
- "columnsFrom": [
- "created_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -23232,12 +25220,8 @@
"name": "goal_nodes_created_by_agent_id_agents_id_fk",
"tableFrom": "goal_nodes",
"tableTo": "agents",
- "columnsFrom": [
- "created_by_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -23247,10 +25231,7 @@
"goal_nodes_goal_id_id_unique": {
"name": "goal_nodes_goal_id_id_unique",
"nullsNotDistinct": false,
- "columns": [
- "goal_id",
- "id"
- ]
+ "columns": ["goal_id", "id"]
}
},
"policies": {},
@@ -23390,12 +25371,8 @@
"name": "goal_shares_goal_id_goals_id_fk",
"tableFrom": "goal_shares",
"tableTo": "goals",
- "columnsFrom": [
- "goal_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["goal_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23403,12 +25380,8 @@
"name": "goal_shares_user_id_users_id_fk",
"tableFrom": "goal_shares",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23416,12 +25389,8 @@
"name": "goal_shares_workspace_id_workspaces_id_fk",
"tableFrom": "goal_shares",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -23720,12 +25689,8 @@
"name": "goal_subscriptions_goal_id_goals_id_fk",
"tableFrom": "goal_subscriptions",
"tableTo": "goals",
- "columnsFrom": [
- "goal_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["goal_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23733,12 +25698,8 @@
"name": "goal_subscriptions_widget_id_widgets_id_fk",
"tableFrom": "goal_subscriptions",
"tableTo": "widgets",
- "columnsFrom": [
- "widget_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["widget_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23746,12 +25707,8 @@
"name": "goal_subscriptions_metric_id_metrics_id_fk",
"tableFrom": "goal_subscriptions",
"tableTo": "metrics",
- "columnsFrom": [
- "metric_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["metric_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23759,12 +25716,8 @@
"name": "goal_subscriptions_user_id_users_id_fk",
"tableFrom": "goal_subscriptions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23772,12 +25725,8 @@
"name": "goal_subscriptions_workspace_id_workspaces_id_fk",
"tableFrom": "goal_subscriptions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23785,12 +25734,8 @@
"name": "goal_subscriptions_confirmed_version_id_widget_versions_id_fk",
"tableFrom": "goal_subscriptions",
"tableTo": "widget_versions",
- "columnsFrom": [
- "confirmed_version_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["confirmed_version_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -23976,12 +25921,340 @@
"name": "goal_traces_goal_id_goals_id_fk",
"tableFrom": "goal_traces",
"tableTo": "goals",
- "columnsFrom": [
- "goal_id"
+ "columnsFrom": ["goal_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.inbound_webhooks": {
+ "name": "inbound_webhooks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "agent_id": {
+ "name": "agent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topic_id": {
+ "name": "topic_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "instructions": {
+ "name": "instructions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "secret": {
+ "name": "secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "verification": {
+ "name": "verification",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'::jsonb"
+ },
+ "connector_id": {
+ "name": "connector_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dedupe_key": {
+ "name": "dedupe_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_maintenance_at": {
+ "name": "next_maintenance_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "maintenance_failures": {
+ "name": "maintenance_failures",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_delivery_at": {
+ "name": "last_delivery_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_error": {
+ "name": "last_error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "wake_count": {
+ "name": "wake_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "wake_window_started_at": {
+ "name": "wake_window_started_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "inbound_webhooks_user_kind_dedupe_unique": {
+ "name": "inbound_webhooks_user_kind_dedupe_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "dedupe_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
],
- "columnsTo": [
- "id"
+ "isUnique": true,
+ "where": "\"inbound_webhooks\".\"dedupe_key\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "inbound_webhooks_next_maintenance_idx": {
+ "name": "inbound_webhooks_next_maintenance_idx",
+ "columns": [
+ {
+ "expression": "next_maintenance_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"inbound_webhooks\".\"next_maintenance_at\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "inbound_webhooks_user_idx": {
+ "name": "inbound_webhooks_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "inbound_webhooks_workspace_idx": {
+ "name": "inbound_webhooks_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "inbound_webhooks_topic_idx": {
+ "name": "inbound_webhooks_topic_idx",
+ "columns": [
+ {
+ "expression": "topic_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "inbound_webhooks_agent_idx": {
+ "name": "inbound_webhooks_agent_idx",
+ "columns": [
+ {
+ "expression": "agent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "inbound_webhooks_connector_idx": {
+ "name": "inbound_webhooks_connector_idx",
+ "columns": [
+ {
+ "expression": "connector_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "inbound_webhooks_user_id_users_id_fk": {
+ "name": "inbound_webhooks_user_id_users_id_fk",
+ "tableFrom": "inbound_webhooks",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "inbound_webhooks_workspace_id_workspaces_id_fk": {
+ "name": "inbound_webhooks_workspace_id_workspaces_id_fk",
+ "tableFrom": "inbound_webhooks",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "inbound_webhooks_agent_id_agents_id_fk": {
+ "name": "inbound_webhooks_agent_id_agents_id_fk",
+ "tableFrom": "inbound_webhooks",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "inbound_webhooks_topic_id_topics_id_fk": {
+ "name": "inbound_webhooks_topic_id_topics_id_fk",
+ "tableFrom": "inbound_webhooks",
+ "tableTo": "topics",
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "inbound_webhooks_connector_id_user_connectors_id_fk": {
+ "name": "inbound_webhooks_connector_id_user_connectors_id_fk",
+ "tableFrom": "inbound_webhooks",
+ "tableTo": "user_connectors",
+ "columnsFrom": ["connector_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -24179,12 +26452,8 @@
"name": "linear_connections_user_id_users_id_fk",
"tableFrom": "linear_connections",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -24192,12 +26461,8 @@
"name": "linear_connections_workspace_id_workspaces_id_fk",
"tableFrom": "linear_connections",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -24374,12 +26639,8 @@
"name": "linear_sync_rules_project_id_projects_id_fk",
"tableFrom": "linear_sync_rules",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -24387,12 +26648,8 @@
"name": "linear_sync_rules_connection_id_linear_connections_id_fk",
"tableFrom": "linear_sync_rules",
"tableTo": "linear_connections",
- "columnsFrom": [
- "connection_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["connection_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -24400,12 +26657,8 @@
"name": "linear_sync_rules_user_id_users_id_fk",
"tableFrom": "linear_sync_rules",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -24413,12 +26666,8 @@
"name": "linear_sync_rules_workspace_id_workspaces_id_fk",
"tableFrom": "linear_sync_rules",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -24838,12 +27087,8 @@
"name": "llm_generation_tracing_workspace_id_workspaces_id_fk",
"tableFrom": "llm_generation_tracing",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -24976,12 +27221,8 @@
"name": "meeting_minutes_meeting_id_meetings_id_fk",
"tableFrom": "meeting_minutes",
"tableTo": "meetings",
- "columnsFrom": [
- "meeting_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["meeting_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -24989,12 +27230,8 @@
"name": "meeting_minutes_document_id_documents_id_fk",
"tableFrom": "meeting_minutes",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -25156,12 +27393,8 @@
"name": "meeting_segments_meeting_id_meetings_id_fk",
"tableFrom": "meeting_segments",
"tableTo": "meetings",
- "columnsFrom": [
- "meeting_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["meeting_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25169,12 +27402,8 @@
"name": "meeting_segments_speaker_id_meeting_speakers_id_fk",
"tableFrom": "meeting_segments",
"tableTo": "meeting_speakers",
- "columnsFrom": [
- "speaker_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["speaker_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -25264,12 +27493,8 @@
"name": "meeting_speakers_meeting_id_meetings_id_fk",
"tableFrom": "meeting_speakers",
"tableTo": "meetings",
- "columnsFrom": [
- "meeting_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["meeting_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -25477,12 +27702,8 @@
"name": "meetings_user_id_users_id_fk",
"tableFrom": "meetings",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25490,12 +27711,8 @@
"name": "meetings_workspace_id_workspaces_id_fk",
"tableFrom": "meetings",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25503,12 +27720,8 @@
"name": "meetings_audio_file_id_files_id_fk",
"tableFrom": "meetings",
"tableTo": "files",
- "columnsFrom": [
- "audio_file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["audio_file_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -25600,12 +27813,8 @@
"name": "message_chunks_message_id_messages_id_fk",
"tableFrom": "message_chunks",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25613,12 +27822,8 @@
"name": "message_chunks_chunk_id_chunks_id_fk",
"tableFrom": "message_chunks",
"tableTo": "chunks",
- "columnsFrom": [
- "chunk_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25626,12 +27831,8 @@
"name": "message_chunks_user_id_users_id_fk",
"tableFrom": "message_chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25639,12 +27840,8 @@
"name": "message_chunks_workspace_id_workspaces_id_fk",
"tableFrom": "message_chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -25652,10 +27849,7 @@
"compositePrimaryKeys": {
"message_chunks_chunk_id_message_id_pk": {
"name": "message_chunks_chunk_id_message_id_pk",
- "columns": [
- "chunk_id",
- "message_id"
- ]
+ "columns": ["chunk_id", "message_id"]
}
},
"uniqueConstraints": {},
@@ -25885,12 +28079,8 @@
"name": "message_groups_topic_id_topics_id_fk",
"tableFrom": "message_groups",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25898,12 +28088,8 @@
"name": "message_groups_user_id_users_id_fk",
"tableFrom": "message_groups",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25911,12 +28097,8 @@
"name": "message_groups_workspace_id_workspaces_id_fk",
"tableFrom": "message_groups",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25924,12 +28106,8 @@
"name": "message_groups_parent_group_id_message_groups_id_fk",
"tableFrom": "message_groups",
"tableTo": "message_groups",
- "columnsFrom": [
- "parent_group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25937,12 +28115,8 @@
"name": "message_groups_parent_message_id_messages_id_fk",
"tableFrom": "message_groups",
"tableTo": "messages",
- "columnsFrom": [
- "parent_message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_message_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -26104,12 +28278,8 @@
"name": "message_plugins_id_messages_id_fk",
"tableFrom": "message_plugins",
"tableTo": "messages",
- "columnsFrom": [
- "id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26117,12 +28287,8 @@
"name": "message_plugins_user_id_users_id_fk",
"tableFrom": "message_plugins",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26130,12 +28296,8 @@
"name": "message_plugins_workspace_id_workspaces_id_fk",
"tableFrom": "message_plugins",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -26288,12 +28450,8 @@
"name": "message_queries_message_id_messages_id_fk",
"tableFrom": "message_queries",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26301,12 +28459,8 @@
"name": "message_queries_user_id_users_id_fk",
"tableFrom": "message_queries",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26314,12 +28468,8 @@
"name": "message_queries_workspace_id_workspaces_id_fk",
"tableFrom": "message_queries",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26327,12 +28477,8 @@
"name": "message_queries_embeddings_id_embeddings_id_fk",
"tableFrom": "message_queries",
"tableTo": "embeddings",
- "columnsFrom": [
- "embeddings_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["embeddings_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -26451,12 +28597,8 @@
"name": "message_query_chunks_id_messages_id_fk",
"tableFrom": "message_query_chunks",
"tableTo": "messages",
- "columnsFrom": [
- "id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26464,12 +28606,8 @@
"name": "message_query_chunks_query_id_message_queries_id_fk",
"tableFrom": "message_query_chunks",
"tableTo": "message_queries",
- "columnsFrom": [
- "query_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["query_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26477,12 +28615,8 @@
"name": "message_query_chunks_chunk_id_chunks_id_fk",
"tableFrom": "message_query_chunks",
"tableTo": "chunks",
- "columnsFrom": [
- "chunk_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26490,12 +28624,8 @@
"name": "message_query_chunks_user_id_users_id_fk",
"tableFrom": "message_query_chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26503,12 +28633,8 @@
"name": "message_query_chunks_workspace_id_workspaces_id_fk",
"tableFrom": "message_query_chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -26516,11 +28642,7 @@
"compositePrimaryKeys": {
"message_query_chunks_chunk_id_id_query_id_pk": {
"name": "message_query_chunks_chunk_id_id_query_id_pk",
- "columns": [
- "chunk_id",
- "id",
- "query_id"
- ]
+ "columns": ["chunk_id", "id", "query_id"]
}
},
"uniqueConstraints": {},
@@ -26633,12 +28755,8 @@
"name": "message_tts_id_messages_id_fk",
"tableFrom": "message_tts",
"tableTo": "messages",
- "columnsFrom": [
- "id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26646,12 +28764,8 @@
"name": "message_tts_file_id_files_id_fk",
"tableFrom": "message_tts",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26659,12 +28773,8 @@
"name": "message_tts_user_id_users_id_fk",
"tableFrom": "message_tts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26672,12 +28782,8 @@
"name": "message_tts_workspace_id_workspaces_id_fk",
"tableFrom": "message_tts",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -26793,12 +28899,8 @@
"name": "message_translates_id_messages_id_fk",
"tableFrom": "message_translates",
"tableTo": "messages",
- "columnsFrom": [
- "id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26806,12 +28908,8 @@
"name": "message_translates_user_id_users_id_fk",
"tableFrom": "message_translates",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26819,12 +28917,8 @@
"name": "message_translates_workspace_id_workspaces_id_fk",
"tableFrom": "message_translates",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -27286,12 +29380,8 @@
"name": "messages_user_id_users_id_fk",
"tableFrom": "messages",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27299,12 +29389,8 @@
"name": "messages_session_id_sessions_id_fk",
"tableFrom": "messages",
"tableTo": "sessions",
- "columnsFrom": [
- "session_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["session_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27312,12 +29398,8 @@
"name": "messages_topic_id_topics_id_fk",
"tableFrom": "messages",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27325,12 +29407,8 @@
"name": "messages_thread_id_threads_id_fk",
"tableFrom": "messages",
"tableTo": "threads",
- "columnsFrom": [
- "thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["thread_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27338,12 +29416,8 @@
"name": "messages_parent_id_messages_id_fk",
"tableFrom": "messages",
"tableTo": "messages",
- "columnsFrom": [
- "parent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -27351,12 +29425,8 @@
"name": "messages_quota_id_messages_id_fk",
"tableFrom": "messages",
"tableTo": "messages",
- "columnsFrom": [
- "quota_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["quota_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -27364,12 +29434,8 @@
"name": "messages_agent_id_agents_id_fk",
"tableFrom": "messages",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27377,12 +29443,8 @@
"name": "messages_group_id_chat_groups_id_fk",
"tableFrom": "messages",
"tableTo": "chat_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -27390,12 +29452,8 @@
"name": "messages_message_group_id_message_groups_id_fk",
"tableFrom": "messages",
"tableTo": "message_groups",
- "columnsFrom": [
- "message_group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27403,12 +29461,8 @@
"name": "messages_workspace_id_workspaces_id_fk",
"tableFrom": "messages",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -27500,12 +29554,8 @@
"name": "messages_files_file_id_files_id_fk",
"tableFrom": "messages_files",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27513,12 +29563,8 @@
"name": "messages_files_message_id_messages_id_fk",
"tableFrom": "messages_files",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27526,12 +29572,8 @@
"name": "messages_files_user_id_users_id_fk",
"tableFrom": "messages_files",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27539,12 +29581,8 @@
"name": "messages_files_workspace_id_workspaces_id_fk",
"tableFrom": "messages_files",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -27552,10 +29590,7 @@
"compositePrimaryKeys": {
"messages_files_file_id_message_id_pk": {
"name": "messages_files_file_id_message_id_pk",
- "columns": [
- "file_id",
- "message_id"
- ]
+ "columns": ["file_id", "message_id"]
}
},
"uniqueConstraints": {},
@@ -27770,12 +29805,8 @@
"name": "messenger_account_links_user_id_users_id_fk",
"tableFrom": "messenger_account_links",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27783,12 +29814,8 @@
"name": "messenger_account_links_workspace_id_workspaces_id_fk",
"tableFrom": "messenger_account_links",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27796,12 +29823,8 @@
"name": "messenger_account_links_active_agent_id_agents_id_fk",
"tableFrom": "messenger_account_links",
"tableTo": "agents",
- "columnsFrom": [
- "active_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["active_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -27976,12 +29999,8 @@
"name": "messenger_installations_installed_by_user_id_users_id_fk",
"tableFrom": "messenger_installations",
"tableTo": "users",
- "columnsFrom": [
- "installed_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["installed_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -28129,12 +30148,8 @@
"name": "metric_points_metric_id_metrics_id_fk",
"tableFrom": "metric_points",
"tableTo": "metrics",
- "columnsFrom": [
- "metric_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["metric_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -28142,12 +30157,8 @@
"name": "metric_points_user_id_users_id_fk",
"tableFrom": "metric_points",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -28155,12 +30166,8 @@
"name": "metric_points_workspace_id_workspaces_id_fk",
"tableFrom": "metric_points",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -28333,12 +30340,8 @@
"name": "metrics_user_id_users_id_fk",
"tableFrom": "metrics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -28346,12 +30349,8 @@
"name": "metrics_workspace_id_workspaces_id_fk",
"tableFrom": "metrics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -28455,12 +30454,8 @@
"name": "nextauth_accounts_user_id_users_id_fk",
"tableFrom": "nextauth_accounts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -28468,10 +30463,7 @@
"compositePrimaryKeys": {
"nextauth_accounts_provider_providerAccountId_pk": {
"name": "nextauth_accounts_provider_providerAccountId_pk",
- "columns": [
- "provider",
- "providerAccountId"
- ]
+ "columns": ["provider", "providerAccountId"]
}
},
"uniqueConstraints": {},
@@ -28538,12 +30530,8 @@
"name": "nextauth_authenticators_user_id_users_id_fk",
"tableFrom": "nextauth_authenticators",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -28551,19 +30539,14 @@
"compositePrimaryKeys": {
"nextauth_authenticators_user_id_credentialID_pk": {
"name": "nextauth_authenticators_user_id_credentialID_pk",
- "columns": [
- "user_id",
- "credentialID"
- ]
+ "columns": ["user_id", "credentialID"]
}
},
"uniqueConstraints": {
"nextauth_authenticators_credentialID_unique": {
"name": "nextauth_authenticators_credentialID_unique",
"nullsNotDistinct": false,
- "columns": [
- "credentialID"
- ]
+ "columns": ["credentialID"]
}
},
"policies": {},
@@ -28615,12 +30598,8 @@
"name": "nextauth_sessions_user_id_users_id_fk",
"tableFrom": "nextauth_sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -28659,10 +30638,7 @@
"compositePrimaryKeys": {
"nextauth_verificationtokens_identifier_token_pk": {
"name": "nextauth_verificationtokens_identifier_token_pk",
- "columns": [
- "identifier",
- "token"
- ]
+ "columns": ["identifier", "token"]
}
},
"uniqueConstraints": {},
@@ -28777,12 +30753,8 @@
"name": "notification_deliveries_notification_id_notifications_id_fk",
"tableFrom": "notification_deliveries",
"tableTo": "notifications",
- "columnsFrom": [
- "notification_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["notification_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -29038,12 +31010,8 @@
"name": "notifications_user_id_users_id_fk",
"tableFrom": "notifications",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -29051,12 +31019,8 @@
"name": "notifications_workspace_id_workspaces_id_fk",
"tableFrom": "notifications",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -29209,12 +31173,8 @@
"name": "oidc_access_tokens_user_id_users_id_fk",
"tableFrom": "oidc_access_tokens",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -29315,12 +31275,8 @@
"name": "oidc_authorization_codes_user_id_users_id_fk",
"tableFrom": "oidc_authorization_codes",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -29509,12 +31465,8 @@
"name": "oidc_clients_user_id_users_id_fk",
"tableFrom": "oidc_clients",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -29522,12 +31474,8 @@
"name": "oidc_clients_workspace_id_workspaces_id_fk",
"tableFrom": "oidc_clients",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -29594,12 +31542,8 @@
"name": "oidc_consents_user_id_users_id_fk",
"tableFrom": "oidc_consents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -29607,12 +31551,8 @@
"name": "oidc_consents_client_id_oidc_clients_id_fk",
"tableFrom": "oidc_consents",
"tableTo": "oidc_clients",
- "columnsFrom": [
- "client_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["client_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -29620,10 +31560,7 @@
"compositePrimaryKeys": {
"oidc_consents_user_id_client_id_pk": {
"name": "oidc_consents_user_id_client_id_pk",
- "columns": [
- "user_id",
- "client_id"
- ]
+ "columns": ["user_id", "client_id"]
}
},
"uniqueConstraints": {},
@@ -29727,12 +31664,8 @@
"name": "oidc_device_codes_user_id_users_id_fk",
"tableFrom": "oidc_device_codes",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -29827,12 +31760,8 @@
"name": "oidc_grants_user_id_users_id_fk",
"tableFrom": "oidc_grants",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -29985,12 +31914,8 @@
"name": "oidc_refresh_tokens_user_id_users_id_fk",
"tableFrom": "oidc_refresh_tokens",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -30073,12 +31998,8 @@
"name": "oidc_sessions_user_id_users_id_fk",
"tableFrom": "oidc_sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -30251,12 +32172,8 @@
"name": "project_agents_project_id_projects_id_fk",
"tableFrom": "project_agents",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -30264,12 +32181,8 @@
"name": "project_agents_agent_id_agents_id_fk",
"tableFrom": "project_agents",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -30277,12 +32190,8 @@
"name": "project_agents_added_by_user_id_users_id_fk",
"tableFrom": "project_agents",
"tableTo": "users",
- "columnsFrom": [
- "added_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["added_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -30290,12 +32199,8 @@
"name": "project_agents_workspace_id_workspaces_id_fk",
"tableFrom": "project_agents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -30468,12 +32373,8 @@
"name": "project_chat_groups_project_id_projects_id_fk",
"tableFrom": "project_chat_groups",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -30481,12 +32382,8 @@
"name": "project_chat_groups_chat_group_id_chat_groups_id_fk",
"tableFrom": "project_chat_groups",
"tableTo": "chat_groups",
- "columnsFrom": [
- "chat_group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chat_group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -30494,12 +32391,8 @@
"name": "project_chat_groups_added_by_user_id_users_id_fk",
"tableFrom": "project_chat_groups",
"tableTo": "users",
- "columnsFrom": [
- "added_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["added_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -30507,12 +32400,8 @@
"name": "project_chat_groups_workspace_id_workspaces_id_fk",
"tableFrom": "project_chat_groups",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -30671,12 +32560,8 @@
"name": "project_completion_reviews_project_id_projects_id_fk",
"tableFrom": "project_completion_reviews",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -30684,12 +32569,8 @@
"name": "project_completion_reviews_reviewer_user_id_users_id_fk",
"tableFrom": "project_completion_reviews",
"tableTo": "users",
- "columnsFrom": [
- "reviewer_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["reviewer_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -30697,12 +32578,8 @@
"name": "project_completion_reviews_workspace_id_workspaces_id_fk",
"tableFrom": "project_completion_reviews",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -30868,12 +32745,8 @@
"name": "project_knowledge_bases_project_id_projects_id_fk",
"tableFrom": "project_knowledge_bases",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -30881,12 +32754,8 @@
"name": "project_knowledge_bases_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "project_knowledge_bases",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -30894,12 +32763,8 @@
"name": "project_knowledge_bases_added_by_user_id_users_id_fk",
"tableFrom": "project_knowledge_bases",
"tableTo": "users",
- "columnsFrom": [
- "added_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["added_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -30907,12 +32772,8 @@
"name": "project_knowledge_bases_workspace_id_workspaces_id_fk",
"tableFrom": "project_knowledge_bases",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -31114,12 +32975,8 @@
"name": "project_working_directories_project_id_projects_id_fk",
"tableFrom": "project_working_directories",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -31127,12 +32984,8 @@
"name": "project_working_directories_device_id_devices_id_fk",
"tableFrom": "project_working_directories",
"tableTo": "devices",
- "columnsFrom": [
- "device_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -31140,12 +32993,8 @@
"name": "project_working_directories_workspace_id_workspaces_id_fk",
"tableFrom": "project_working_directories",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -31153,12 +33002,8 @@
"name": "project_working_directories_added_by_user_id_users_id_fk",
"tableFrom": "project_working_directories",
"tableTo": "users",
- "columnsFrom": [
- "added_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["added_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -31544,12 +33389,8 @@
"name": "projects_coordinator_agent_id_agents_id_fk",
"tableFrom": "projects",
"tableTo": "agents",
- "columnsFrom": [
- "coordinator_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["coordinator_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -31557,12 +33398,8 @@
"name": "projects_user_id_users_id_fk",
"tableFrom": "projects",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -31570,12 +33407,8 @@
"name": "projects_workspace_id_workspaces_id_fk",
"tableFrom": "projects",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -31800,12 +33633,8 @@
"name": "project_environments_project_id_projects_id_fk",
"tableFrom": "project_environments",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -31813,12 +33642,8 @@
"name": "project_environments_environment_id_environments_id_fk",
"tableFrom": "project_environments",
"tableTo": "environments",
- "columnsFrom": [
- "environment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["environment_id"],
+ "columnsTo": ["id"],
"onDelete": "restrict",
"onUpdate": "no action"
},
@@ -31826,12 +33651,8 @@
"name": "project_environments_workspace_id_workspaces_id_fk",
"tableFrom": "project_environments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -31839,12 +33660,8 @@
"name": "project_environments_added_by_user_id_users_id_fk",
"tableFrom": "project_environments",
"tableTo": "users",
- "columnsFrom": [
- "added_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["added_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -31852,14 +33669,8 @@
"name": "project_environments_default_instance_fk",
"tableFrom": "project_environments",
"tableTo": "environment_instances",
- "columnsFrom": [
- "environment_id",
- "default_instance_id"
- ],
- "columnsTo": [
- "environment_id",
- "id"
- ],
+ "columnsFrom": ["environment_id", "default_instance_id"],
+ "columnsTo": ["environment_id", "id"],
"onDelete": "restrict",
"onUpdate": "no action"
}
@@ -31997,12 +33808,8 @@
"name": "project_members_project_id_projects_id_fk",
"tableFrom": "project_members",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -32010,12 +33817,8 @@
"name": "project_members_user_id_users_id_fk",
"tableFrom": "project_members",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -32023,12 +33826,8 @@
"name": "project_members_added_by_user_id_users_id_fk",
"tableFrom": "project_members",
"tableTo": "users",
- "columnsFrom": [
- "added_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["added_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -32150,12 +33949,8 @@
"name": "project_sites_project_id_projects_id_fk",
"tableFrom": "project_sites",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -32163,12 +33958,8 @@
"name": "project_sites_workspace_id_workspaces_id_fk",
"tableFrom": "project_sites",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -32176,12 +33967,8 @@
"name": "project_sites_created_by_user_id_users_id_fk",
"tableFrom": "project_sites",
"tableTo": "users",
- "columnsFrom": [
- "created_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -32189,12 +33976,8 @@
"name": "project_sites_acceptance_id_acceptances_id_fk",
"tableFrom": "project_sites",
"tableTo": "acceptances",
- "columnsFrom": [
- "acceptance_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["acceptance_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -32357,12 +34140,8 @@
"name": "project_works_project_id_projects_id_fk",
"tableFrom": "project_works",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -32370,12 +34149,8 @@
"name": "project_works_work_id_works_id_fk",
"tableFrom": "project_works",
"tableTo": "works",
- "columnsFrom": [
- "work_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["work_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -32383,12 +34158,8 @@
"name": "project_works_added_by_user_id_users_id_fk",
"tableFrom": "project_works",
"tableTo": "users",
- "columnsFrom": [
- "added_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["added_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -32396,12 +34167,8 @@
"name": "project_works_workspace_id_workspaces_id_fk",
"tableFrom": "project_works",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -32571,12 +34338,8 @@
"name": "push_live_activities_user_id_users_id_fk",
"tableFrom": "push_live_activities",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -32724,12 +34487,8 @@
"name": "push_tokens_user_id_users_id_fk",
"tableFrom": "push_tokens",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -32884,12 +34643,8 @@
"name": "chunks_user_id_users_id_fk",
"tableFrom": "chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -32897,12 +34652,8 @@
"name": "chunks_workspace_id_workspaces_id_fk",
"tableFrom": "chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -33022,12 +34773,8 @@
"name": "document_chunks_document_id_documents_id_fk",
"tableFrom": "document_chunks",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33035,12 +34782,8 @@
"name": "document_chunks_chunk_id_chunks_id_fk",
"tableFrom": "document_chunks",
"tableTo": "chunks",
- "columnsFrom": [
- "chunk_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33048,12 +34791,8 @@
"name": "document_chunks_user_id_users_id_fk",
"tableFrom": "document_chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33061,12 +34800,8 @@
"name": "document_chunks_workspace_id_workspaces_id_fk",
"tableFrom": "document_chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -33074,10 +34809,7 @@
"compositePrimaryKeys": {
"document_chunks_document_id_chunk_id_pk": {
"name": "document_chunks_document_id_chunk_id_pk",
- "columns": [
- "document_id",
- "chunk_id"
- ]
+ "columns": ["document_id", "chunk_id"]
}
},
"uniqueConstraints": {},
@@ -33206,12 +34938,8 @@
"name": "embeddings_chunk_id_chunks_id_fk",
"tableFrom": "embeddings",
"tableTo": "chunks",
- "columnsFrom": [
- "chunk_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33219,12 +34947,8 @@
"name": "embeddings_user_id_users_id_fk",
"tableFrom": "embeddings",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33232,12 +34956,8 @@
"name": "embeddings_workspace_id_workspaces_id_fk",
"tableFrom": "embeddings",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -33247,9 +34967,7 @@
"embeddings_chunk_id_unique": {
"name": "embeddings_chunk_id_unique",
"nullsNotDistinct": false,
- "columns": [
- "chunk_id"
- ]
+ "columns": ["chunk_id"]
}
},
"policies": {},
@@ -33437,12 +35155,8 @@
"name": "unstructured_chunks_composite_id_chunks_id_fk",
"tableFrom": "unstructured_chunks",
"tableTo": "chunks",
- "columnsFrom": [
- "composite_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["composite_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33450,12 +35164,8 @@
"name": "unstructured_chunks_user_id_users_id_fk",
"tableFrom": "unstructured_chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33463,12 +35173,8 @@
"name": "unstructured_chunks_workspace_id_workspaces_id_fk",
"tableFrom": "unstructured_chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33476,12 +35182,8 @@
"name": "unstructured_chunks_file_id_files_id_fk",
"tableFrom": "unstructured_chunks",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -33603,12 +35305,8 @@
"name": "rag_eval_dataset_records_dataset_id_rag_eval_datasets_id_fk",
"tableFrom": "rag_eval_dataset_records",
"tableTo": "rag_eval_datasets",
- "columnsFrom": [
- "dataset_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dataset_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33616,12 +35314,8 @@
"name": "rag_eval_dataset_records_user_id_users_id_fk",
"tableFrom": "rag_eval_dataset_records",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33629,12 +35323,8 @@
"name": "rag_eval_dataset_records_workspace_id_workspaces_id_fk",
"tableFrom": "rag_eval_dataset_records",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -33744,12 +35434,8 @@
"name": "rag_eval_datasets_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "rag_eval_datasets",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33757,12 +35443,8 @@
"name": "rag_eval_datasets_user_id_users_id_fk",
"tableFrom": "rag_eval_datasets",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33770,12 +35452,8 @@
"name": "rag_eval_datasets_workspace_id_workspaces_id_fk",
"tableFrom": "rag_eval_datasets",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -33921,12 +35599,8 @@
"name": "rag_eval_evaluations_dataset_id_rag_eval_datasets_id_fk",
"tableFrom": "rag_eval_evaluations",
"tableTo": "rag_eval_datasets",
- "columnsFrom": [
- "dataset_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dataset_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33934,12 +35608,8 @@
"name": "rag_eval_evaluations_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "rag_eval_evaluations",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33947,12 +35617,8 @@
"name": "rag_eval_evaluations_user_id_users_id_fk",
"tableFrom": "rag_eval_evaluations",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -33960,12 +35626,8 @@
"name": "rag_eval_evaluations_workspace_id_workspaces_id_fk",
"tableFrom": "rag_eval_evaluations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -34129,12 +35791,8 @@
"name": "rag_eval_evaluation_records_question_embedding_id_embeddings_id_fk",
"tableFrom": "rag_eval_evaluation_records",
"tableTo": "embeddings",
- "columnsFrom": [
- "question_embedding_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["question_embedding_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -34142,12 +35800,8 @@
"name": "rag_eval_evaluation_records_dataset_record_id_rag_eval_dataset_records_id_fk",
"tableFrom": "rag_eval_evaluation_records",
"tableTo": "rag_eval_dataset_records",
- "columnsFrom": [
- "dataset_record_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dataset_record_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34155,12 +35809,8 @@
"name": "rag_eval_evaluation_records_evaluation_id_rag_eval_evaluations_id_fk",
"tableFrom": "rag_eval_evaluation_records",
"tableTo": "rag_eval_evaluations",
- "columnsFrom": [
- "evaluation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["evaluation_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34168,12 +35818,8 @@
"name": "rag_eval_evaluation_records_user_id_users_id_fk",
"tableFrom": "rag_eval_evaluation_records",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34181,12 +35827,8 @@
"name": "rag_eval_evaluation_records_workspace_id_workspaces_id_fk",
"tableFrom": "rag_eval_evaluation_records",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -34267,9 +35909,7 @@
"rbac_permissions_code_unique": {
"name": "rbac_permissions_code_unique",
"nullsNotDistinct": false,
- "columns": [
- "code"
- ]
+ "columns": ["code"]
}
},
"policies": {},
@@ -34337,12 +35977,8 @@
"name": "rbac_role_permissions_role_id_rbac_roles_id_fk",
"tableFrom": "rbac_role_permissions",
"tableTo": "rbac_roles",
- "columnsFrom": [
- "role_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34350,12 +35986,8 @@
"name": "rbac_role_permissions_permission_id_rbac_permissions_id_fk",
"tableFrom": "rbac_role_permissions",
"tableTo": "rbac_permissions",
- "columnsFrom": [
- "permission_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["permission_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -34363,10 +35995,7 @@
"compositePrimaryKeys": {
"rbac_role_permissions_role_id_permission_id_pk": {
"name": "rbac_role_permissions_role_id_permission_id_pk",
- "columns": [
- "role_id",
- "permission_id"
- ]
+ "columns": ["role_id", "permission_id"]
}
},
"uniqueConstraints": {},
@@ -34494,12 +36123,8 @@
"name": "rbac_roles_workspace_id_workspaces_id_fk",
"tableFrom": "rbac_roles",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -34632,12 +36257,8 @@
"name": "rbac_user_roles_user_id_users_id_fk",
"tableFrom": "rbac_user_roles",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34645,12 +36266,8 @@
"name": "rbac_user_roles_role_id_rbac_roles_id_fk",
"tableFrom": "rbac_user_roles",
"tableTo": "rbac_roles",
- "columnsFrom": [
- "role_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34658,12 +36275,8 @@
"name": "rbac_user_roles_workspace_id_workspaces_id_fk",
"tableFrom": "rbac_user_roles",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -34770,12 +36383,8 @@
"name": "agents_to_sessions_agent_id_agents_id_fk",
"tableFrom": "agents_to_sessions",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34783,12 +36392,8 @@
"name": "agents_to_sessions_session_id_sessions_id_fk",
"tableFrom": "agents_to_sessions",
"tableTo": "sessions",
- "columnsFrom": [
- "session_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["session_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34796,12 +36401,8 @@
"name": "agents_to_sessions_user_id_users_id_fk",
"tableFrom": "agents_to_sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34809,12 +36410,8 @@
"name": "agents_to_sessions_workspace_id_workspaces_id_fk",
"tableFrom": "agents_to_sessions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -34822,10 +36419,7 @@
"compositePrimaryKeys": {
"agents_to_sessions_agent_id_session_id_pk": {
"name": "agents_to_sessions_agent_id_session_id_pk",
- "columns": [
- "agent_id",
- "session_id"
- ]
+ "columns": ["agent_id", "session_id"]
}
},
"uniqueConstraints": {},
@@ -34936,12 +36530,8 @@
"name": "file_chunks_file_id_files_id_fk",
"tableFrom": "file_chunks",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34949,12 +36539,8 @@
"name": "file_chunks_chunk_id_chunks_id_fk",
"tableFrom": "file_chunks",
"tableTo": "chunks",
- "columnsFrom": [
- "chunk_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34962,12 +36548,8 @@
"name": "file_chunks_user_id_users_id_fk",
"tableFrom": "file_chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -34975,12 +36557,8 @@
"name": "file_chunks_workspace_id_workspaces_id_fk",
"tableFrom": "file_chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -34988,10 +36566,7 @@
"compositePrimaryKeys": {
"file_chunks_file_id_chunk_id_pk": {
"name": "file_chunks_file_id_chunk_id_pk",
- "columns": [
- "file_id",
- "chunk_id"
- ]
+ "columns": ["file_id", "chunk_id"]
}
},
"uniqueConstraints": {},
@@ -35095,12 +36670,8 @@
"name": "files_to_sessions_file_id_files_id_fk",
"tableFrom": "files_to_sessions",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -35108,12 +36679,8 @@
"name": "files_to_sessions_session_id_sessions_id_fk",
"tableFrom": "files_to_sessions",
"tableTo": "sessions",
- "columnsFrom": [
- "session_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["session_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -35121,12 +36688,8 @@
"name": "files_to_sessions_user_id_users_id_fk",
"tableFrom": "files_to_sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -35134,12 +36697,8 @@
"name": "files_to_sessions_workspace_id_workspaces_id_fk",
"tableFrom": "files_to_sessions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -35147,10 +36706,7 @@
"compositePrimaryKeys": {
"files_to_sessions_file_id_session_id_pk": {
"name": "files_to_sessions_file_id_session_id_pk",
- "columns": [
- "file_id",
- "session_id"
- ]
+ "columns": ["file_id", "session_id"]
}
},
"uniqueConstraints": {},
@@ -35383,12 +36939,8 @@
"name": "resource_permissions_workspace_id_workspaces_id_fk",
"tableFrom": "resource_permissions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -35396,12 +36948,8 @@
"name": "resource_permissions_user_id_users_id_fk",
"tableFrom": "resource_permissions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -35409,12 +36957,8 @@
"name": "resource_permissions_created_by_users_id_fk",
"tableFrom": "resource_permissions",
"tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -35584,12 +37128,8 @@
"name": "resource_transfer_requests_workspace_id_workspaces_id_fk",
"tableFrom": "resource_transfer_requests",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -35597,12 +37137,8 @@
"name": "resource_transfer_requests_initiator_id_users_id_fk",
"tableFrom": "resource_transfer_requests",
"tableTo": "users",
- "columnsFrom": [
- "initiator_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["initiator_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -35610,12 +37146,8 @@
"name": "resource_transfer_requests_recipient_id_users_id_fk",
"tableFrom": "resource_transfer_requests",
"tableTo": "users",
- "columnsFrom": [
- "recipient_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["recipient_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -35623,12 +37155,8 @@
"name": "resource_transfer_requests_previous_owner_id_users_id_fk",
"tableFrom": "resource_transfer_requests",
"tableTo": "users",
- "columnsFrom": [
- "previous_owner_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["previous_owner_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -36023,12 +37551,8 @@
"name": "scm_change_requests_user_id_users_id_fk",
"tableFrom": "scm_change_requests",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -36036,12 +37560,8 @@
"name": "scm_change_requests_workspace_id_workspaces_id_fk",
"tableFrom": "scm_change_requests",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -36049,12 +37569,8 @@
"name": "scm_change_requests_installation_id_scm_installations_id_fk",
"tableFrom": "scm_change_requests",
"tableTo": "scm_installations",
- "columnsFrom": [
- "installation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["installation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -36062,12 +37578,8 @@
"name": "scm_change_requests_acceptance_id_acceptances_id_fk",
"tableFrom": "scm_change_requests",
"tableTo": "acceptances",
- "columnsFrom": [
- "acceptance_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["acceptance_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -36075,12 +37587,8 @@
"name": "scm_change_requests_work_id_works_id_fk",
"tableFrom": "scm_change_requests",
"tableTo": "works",
- "columnsFrom": [
- "work_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["work_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -36088,12 +37596,8 @@
"name": "scm_change_requests_topic_id_topics_id_fk",
"tableFrom": "scm_change_requests",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -36101,12 +37605,8 @@
"name": "scm_change_requests_task_id_tasks_id_fk",
"tableFrom": "scm_change_requests",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -36257,12 +37757,8 @@
"name": "scm_identities_user_id_users_id_fk",
"tableFrom": "scm_identities",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -36471,12 +37967,8 @@
"name": "scm_installations_user_id_users_id_fk",
"tableFrom": "scm_installations",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -36484,12 +37976,8 @@
"name": "scm_installations_workspace_id_workspaces_id_fk",
"tableFrom": "scm_installations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -36790,12 +38278,8 @@
"name": "session_groups_user_id_users_id_fk",
"tableFrom": "session_groups",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -36803,12 +38287,8 @@
"name": "session_groups_workspace_id_workspaces_id_fk",
"tableFrom": "session_groups",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -37078,12 +38558,8 @@
"name": "sessions_user_id_users_id_fk",
"tableFrom": "sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -37091,12 +38567,8 @@
"name": "sessions_group_id_session_groups_id_fk",
"tableFrom": "sessions",
"tableTo": "session_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -37104,12 +38576,8 @@
"name": "sessions_workspace_id_workspaces_id_fk",
"tableFrom": "sessions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -37387,12 +38855,8 @@
"name": "signals_user_id_users_id_fk",
"tableFrom": "signals",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -37400,12 +38864,8 @@
"name": "signals_workspace_id_workspaces_id_fk",
"tableFrom": "signals",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -37413,12 +38873,8 @@
"name": "signals_account_id_agent_accounts_id_fk",
"tableFrom": "signals",
"tableTo": "agent_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -37426,12 +38882,8 @@
"name": "signals_agent_id_agents_id_fk",
"tableFrom": "signals",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -37526,12 +38978,8 @@
"name": "signal_decision_labels_decision_id_signal_decisions_id_fk",
"tableFrom": "signal_decision_labels",
"tableTo": "signal_decisions",
- "columnsFrom": [
- "decision_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["decision_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -37745,12 +39193,8 @@
"name": "signal_decisions_signal_id_signals_id_fk",
"tableFrom": "signal_decisions",
"tableTo": "signals",
- "columnsFrom": [
- "signal_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["signal_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -37758,12 +39202,8 @@
"name": "signal_decisions_agent_id_agents_id_fk",
"tableFrom": "signal_decisions",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -37771,12 +39211,8 @@
"name": "signal_decisions_user_id_users_id_fk",
"tableFrom": "signal_decisions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -37784,12 +39220,8 @@
"name": "signal_decisions_workspace_id_workspaces_id_fk",
"tableFrom": "signal_decisions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -37797,12 +39229,8 @@
"name": "signal_decisions_topic_id_topics_id_fk",
"tableFrom": "signal_decisions",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -38183,12 +39611,8 @@
"name": "briefs_user_id_users_id_fk",
"tableFrom": "briefs",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38196,12 +39620,8 @@
"name": "briefs_workspace_id_workspaces_id_fk",
"tableFrom": "briefs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38209,12 +39629,8 @@
"name": "briefs_task_id_tasks_id_fk",
"tableFrom": "briefs",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38222,12 +39638,8 @@
"name": "briefs_cron_job_id_agent_cron_jobs_id_fk",
"tableFrom": "briefs",
"tableTo": "agent_cron_jobs",
- "columnsFrom": [
- "cron_job_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["cron_job_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -38385,12 +39797,8 @@
"name": "task_activities_task_id_tasks_id_fk",
"tableFrom": "task_activities",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38398,12 +39806,8 @@
"name": "task_activities_user_id_users_id_fk",
"tableFrom": "task_activities",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38411,12 +39815,8 @@
"name": "task_activities_workspace_id_workspaces_id_fk",
"tableFrom": "task_activities",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38424,12 +39824,8 @@
"name": "task_activities_actor_user_id_users_id_fk",
"tableFrom": "task_activities",
"tableTo": "users",
- "columnsFrom": [
- "actor_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["actor_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -38437,12 +39833,8 @@
"name": "task_activities_actor_agent_id_agents_id_fk",
"tableFrom": "task_activities",
"tableTo": "agents",
- "columnsFrom": [
- "actor_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["actor_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -38685,12 +40077,8 @@
"name": "task_comments_task_id_tasks_id_fk",
"tableFrom": "task_comments",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38698,12 +40086,8 @@
"name": "task_comments_user_id_users_id_fk",
"tableFrom": "task_comments",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38711,12 +40095,8 @@
"name": "task_comments_workspace_id_workspaces_id_fk",
"tableFrom": "task_comments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38724,12 +40104,8 @@
"name": "task_comments_author_user_id_users_id_fk",
"tableFrom": "task_comments",
"tableTo": "users",
- "columnsFrom": [
- "author_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["author_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -38737,12 +40113,8 @@
"name": "task_comments_author_agent_id_agents_id_fk",
"tableFrom": "task_comments",
"tableTo": "agents",
- "columnsFrom": [
- "author_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["author_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -38750,12 +40122,8 @@
"name": "task_comments_brief_id_briefs_id_fk",
"tableFrom": "task_comments",
"tableTo": "briefs",
- "columnsFrom": [
- "brief_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["brief_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -38763,12 +40131,8 @@
"name": "task_comments_topic_id_topics_id_fk",
"tableFrom": "task_comments",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -38957,12 +40321,8 @@
"name": "task_dependencies_task_id_tasks_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38970,12 +40330,8 @@
"name": "task_dependencies_depends_on_id_tasks_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "tasks",
- "columnsFrom": [
- "depends_on_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["depends_on_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38983,12 +40339,8 @@
"name": "task_dependencies_user_id_users_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -38996,12 +40348,8 @@
"name": "task_dependencies_workspace_id_workspaces_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -39184,12 +40532,8 @@
"name": "task_documents_task_id_tasks_id_fk",
"tableFrom": "task_documents",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -39197,12 +40541,8 @@
"name": "task_documents_document_id_documents_id_fk",
"tableFrom": "task_documents",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -39210,12 +40550,8 @@
"name": "task_documents_user_id_users_id_fk",
"tableFrom": "task_documents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -39223,12 +40559,8 @@
"name": "task_documents_workspace_id_workspaces_id_fk",
"tableFrom": "task_documents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -39500,12 +40832,8 @@
"name": "task_topics_task_id_tasks_id_fk",
"tableFrom": "task_topics",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -39513,12 +40841,8 @@
"name": "task_topics_topic_id_topics_id_fk",
"tableFrom": "task_topics",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -39526,12 +40850,8 @@
"name": "task_topics_user_id_users_id_fk",
"tableFrom": "task_topics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -39539,12 +40859,8 @@
"name": "task_topics_workspace_id_workspaces_id_fk",
"tableFrom": "task_topics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -40054,12 +41370,8 @@
"name": "tasks_created_by_user_id_users_id_fk",
"tableFrom": "tasks",
"tableTo": "users",
- "columnsFrom": [
- "created_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -40067,12 +41379,8 @@
"name": "tasks_workspace_id_workspaces_id_fk",
"tableFrom": "tasks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -40080,12 +41388,8 @@
"name": "tasks_project_id_projects_id_fk",
"tableFrom": "tasks",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -40093,12 +41397,8 @@
"name": "tasks_created_by_agent_id_agents_id_fk",
"tableFrom": "tasks",
"tableTo": "agents",
- "columnsFrom": [
- "created_by_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -40106,12 +41406,8 @@
"name": "tasks_assignee_user_id_users_id_fk",
"tableFrom": "tasks",
"tableTo": "users",
- "columnsFrom": [
- "assignee_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["assignee_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -40119,12 +41415,8 @@
"name": "tasks_assignee_agent_id_agents_id_fk",
"tableFrom": "tasks",
"tableTo": "agents",
- "columnsFrom": [
- "assignee_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["assignee_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -40132,12 +41424,8 @@
"name": "tasks_current_topic_id_topics_id_fk",
"tableFrom": "tasks",
"tableTo": "topics",
- "columnsFrom": [
- "current_topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["current_topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -40145,12 +41433,8 @@
"name": "tasks_parent_task_id_tasks_id_fk",
"tableFrom": "tasks",
"tableTo": "tasks",
- "columnsFrom": [
- "parent_task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -40382,12 +41666,8 @@
"name": "task_external_links_task_id_tasks_id_fk",
"tableFrom": "task_external_links",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -40395,12 +41675,8 @@
"name": "task_external_links_user_id_users_id_fk",
"tableFrom": "task_external_links",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -40408,12 +41684,8 @@
"name": "task_external_links_workspace_id_workspaces_id_fk",
"tableFrom": "task_external_links",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -40540,12 +41812,8 @@
"name": "task_label_links_task_id_tasks_id_fk",
"tableFrom": "task_label_links",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -40553,12 +41821,8 @@
"name": "task_label_links_label_id_task_labels_id_fk",
"tableFrom": "task_label_links",
"tableTo": "task_labels",
- "columnsFrom": [
- "label_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["label_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -40566,12 +41830,8 @@
"name": "task_label_links_user_id_users_id_fk",
"tableFrom": "task_label_links",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -40579,12 +41839,8 @@
"name": "task_label_links_workspace_id_workspaces_id_fk",
"tableFrom": "task_label_links",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -40774,12 +42030,8 @@
"name": "task_labels_user_id_users_id_fk",
"tableFrom": "task_labels",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -40787,12 +42039,8 @@
"name": "task_labels_workspace_id_workspaces_id_fk",
"tableFrom": "task_labels",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -40800,12 +42048,8 @@
"name": "task_labels_parent_id_task_labels_id_fk",
"tableFrom": "task_labels",
"tableTo": "task_labels",
- "columnsFrom": [
- "parent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -41084,12 +42328,8 @@
"name": "threads_topic_id_topics_id_fk",
"tableFrom": "threads",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -41097,12 +42337,8 @@
"name": "threads_parent_thread_id_threads_id_fk",
"tableFrom": "threads",
"tableTo": "threads",
- "columnsFrom": [
- "parent_thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_thread_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -41110,12 +42346,8 @@
"name": "threads_agent_id_agents_id_fk",
"tableFrom": "threads",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -41123,12 +42355,8 @@
"name": "threads_group_id_chat_groups_id_fk",
"tableFrom": "threads",
"tableTo": "chat_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -41136,12 +42364,8 @@
"name": "threads_user_id_users_id_fk",
"tableFrom": "threads",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -41149,12 +42373,8 @@
"name": "threads_workspace_id_workspaces_id_fk",
"tableFrom": "threads",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -41268,12 +42488,8 @@
"name": "topic_documents_document_id_documents_id_fk",
"tableFrom": "topic_documents",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -41281,12 +42497,8 @@
"name": "topic_documents_topic_id_topics_id_fk",
"tableFrom": "topic_documents",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -41294,12 +42506,8 @@
"name": "topic_documents_user_id_users_id_fk",
"tableFrom": "topic_documents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -41307,12 +42515,8 @@
"name": "topic_documents_workspace_id_workspaces_id_fk",
"tableFrom": "topic_documents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -41320,10 +42524,7 @@
"compositePrimaryKeys": {
"topic_documents_document_id_topic_id_pk": {
"name": "topic_documents_document_id_topic_id_pk",
- "columns": [
- "document_id",
- "topic_id"
- ]
+ "columns": ["document_id", "topic_id"]
}
},
"uniqueConstraints": {},
@@ -41447,12 +42648,8 @@
"name": "topic_shares_topic_id_topics_id_fk",
"tableFrom": "topic_shares",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -41460,12 +42657,8 @@
"name": "topic_shares_user_id_users_id_fk",
"tableFrom": "topic_shares",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -41473,12 +42666,8 @@
"name": "topic_shares_workspace_id_workspaces_id_fk",
"tableFrom": "topic_shares",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -41984,12 +43173,8 @@
"name": "topics_session_id_sessions_id_fk",
"tableFrom": "topics",
"tableTo": "sessions",
- "columnsFrom": [
- "session_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["session_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -41997,12 +43182,8 @@
"name": "topics_agent_id_agents_id_fk",
"tableFrom": "topics",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -42010,12 +43191,8 @@
"name": "topics_group_id_chat_groups_id_fk",
"tableFrom": "topics",
"tableTo": "chat_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -42023,12 +43200,8 @@
"name": "topics_project_id_projects_id_fk",
"tableFrom": "topics",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -42036,12 +43209,8 @@
"name": "topics_project_working_directory_id_project_working_directories_id_fk",
"tableFrom": "topics",
"tableTo": "project_working_directories",
- "columnsFrom": [
- "project_working_directory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_working_directory_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -42049,12 +43218,8 @@
"name": "topics_user_id_users_id_fk",
"tableFrom": "topics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -42062,12 +43227,8 @@
"name": "topics_workspace_id_workspaces_id_fk",
"tableFrom": "topics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -42347,12 +43508,8 @@
"name": "topic_analyses_topic_id_topics_id_fk",
"tableFrom": "topic_analyses",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -42360,12 +43517,8 @@
"name": "topic_analyses_user_id_users_id_fk",
"tableFrom": "topic_analyses",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -42373,12 +43526,8 @@
"name": "topic_analyses_workspace_id_workspaces_id_fk",
"tableFrom": "topic_analyses",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -42490,12 +43639,8 @@
"name": "topic_comment_mentions_comment_id_topic_comments_id_fk",
"tableFrom": "topic_comment_mentions",
"tableTo": "topic_comments",
- "columnsFrom": [
- "comment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["comment_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -42503,12 +43648,8 @@
"name": "topic_comment_mentions_mentioned_user_id_users_id_fk",
"tableFrom": "topic_comment_mentions",
"tableTo": "users",
- "columnsFrom": [
- "mentioned_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["mentioned_user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -42516,12 +43657,8 @@
"name": "topic_comment_mentions_workspace_id_workspaces_id_fk",
"tableFrom": "topic_comment_mentions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -42819,12 +43956,8 @@
"name": "topic_comments_topic_id_topics_id_fk",
"tableFrom": "topic_comments",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -42832,12 +43965,8 @@
"name": "topic_comments_message_id_messages_id_fk",
"tableFrom": "topic_comments",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -42845,12 +43974,8 @@
"name": "topic_comments_parent_comment_id_topic_comments_id_fk",
"tableFrom": "topic_comments",
"tableTo": "topic_comments",
- "columnsFrom": [
- "parent_comment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_comment_id"],
+ "columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
},
@@ -42858,12 +43983,8 @@
"name": "topic_comments_author_user_id_users_id_fk",
"tableFrom": "topic_comments",
"tableTo": "users",
- "columnsFrom": [
- "author_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["author_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -42871,12 +43992,8 @@
"name": "topic_comments_workspace_id_workspaces_id_fk",
"tableFrom": "topic_comments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -42884,12 +44001,8 @@
"name": "topic_comments_moderated_by_user_id_users_id_fk",
"tableFrom": "topic_comments",
"tableTo": "users",
- "columnsFrom": [
- "moderated_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["moderated_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -43136,12 +44249,8 @@
"name": "trash_items_root_id_trash_items_id_fk",
"tableFrom": "trash_items",
"tableTo": "trash_items",
- "columnsFrom": [
- "root_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["root_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -43149,12 +44258,8 @@
"name": "trash_items_user_id_users_id_fk",
"tableFrom": "trash_items",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -43162,12 +44267,8 @@
"name": "trash_items_workspace_id_workspaces_id_fk",
"tableFrom": "trash_items",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -43175,12 +44276,8 @@
"name": "trash_items_deleted_by_user_id_users_id_fk",
"tableFrom": "trash_items",
"tableTo": "users",
- "columnsFrom": [
- "deleted_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["deleted_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -43280,12 +44377,8 @@
"name": "user_settings_id_users_id_fk",
"tableFrom": "user_settings",
"tableTo": "users",
- "columnsFrom": [
- "id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -43540,30 +44633,22 @@
"users_username_unique": {
"name": "users_username_unique",
"nullsNotDistinct": false,
- "columns": [
- "username"
- ]
+ "columns": ["username"]
},
"users_email_unique": {
"name": "users_email_unique",
"nullsNotDistinct": false,
- "columns": [
- "email"
- ]
+ "columns": ["email"]
},
"users_normalized_email_unique": {
"name": "users_normalized_email_unique",
"nullsNotDistinct": false,
- "columns": [
- "normalized_email"
- ]
+ "columns": ["normalized_email"]
},
"users_phone_unique": {
"name": "users_phone_unique",
"nullsNotDistinct": false,
- "columns": [
- "phone"
- ]
+ "columns": ["phone"]
}
},
"policies": {},
@@ -43840,12 +44925,8 @@
"name": "user_memories_activities_user_id_users_id_fk",
"tableFrom": "user_memories_activities",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -43853,12 +44934,8 @@
"name": "user_memories_activities_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_activities",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -43866,12 +44943,8 @@
"name": "user_memories_activities_dossier_id_user_memories_dossiers_id_fk",
"tableFrom": "user_memories_activities",
"tableTo": "user_memories_dossiers",
- "columnsFrom": [
- "dossier_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dossier_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -44085,12 +45158,8 @@
"name": "user_memories_user_id_users_id_fk",
"tableFrom": "user_memories",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -44236,12 +45305,8 @@
"name": "user_memories_context_projects_context_id_user_memories_contexts_id_fk",
"tableFrom": "user_memories_context_projects",
"tableTo": "user_memories_contexts",
- "columnsFrom": [
- "context_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["context_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -44249,12 +45314,8 @@
"name": "user_memories_context_projects_project_id_projects_id_fk",
"tableFrom": "user_memories_context_projects",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -44262,12 +45323,8 @@
"name": "user_memories_context_projects_user_id_users_id_fk",
"tableFrom": "user_memories_context_projects",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -44543,12 +45600,8 @@
"name": "user_memories_contexts_user_id_users_id_fk",
"tableFrom": "user_memories_contexts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -44556,12 +45609,8 @@
"name": "user_memories_contexts_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_contexts",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -44840,12 +45889,8 @@
"name": "user_memories_dossiers_context_id_user_memories_contexts_id_fk",
"tableFrom": "user_memories_dossiers",
"tableTo": "user_memories_contexts",
- "columnsFrom": [
- "context_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["context_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -44853,12 +45898,8 @@
"name": "user_memories_dossiers_user_id_users_id_fk",
"tableFrom": "user_memories_dossiers",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -44866,12 +45907,8 @@
"name": "user_memories_dossiers_workspace_id_workspaces_id_fk",
"tableFrom": "user_memories_dossiers",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -44879,12 +45916,8 @@
"name": "user_memories_dossiers_agent_id_agents_id_fk",
"tableFrom": "user_memories_dossiers",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -44892,12 +45925,8 @@
"name": "user_memories_dossiers_project_id_projects_id_fk",
"tableFrom": "user_memories_dossiers",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -44905,12 +45934,8 @@
"name": "user_memories_dossiers_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_dossiers",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -45094,12 +46119,8 @@
"name": "user_memories_edges_source_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_edges",
"tableTo": "user_memories",
- "columnsFrom": [
- "source_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["source_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45107,12 +46128,8 @@
"name": "user_memories_edges_target_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_edges",
"tableTo": "user_memories",
- "columnsFrom": [
- "target_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["target_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45120,12 +46137,8 @@
"name": "user_memories_edges_user_id_users_id_fk",
"tableFrom": "user_memories_edges",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45133,12 +46146,8 @@
"name": "user_memories_edges_workspace_id_workspaces_id_fk",
"tableFrom": "user_memories_edges",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -45415,12 +46424,8 @@
"name": "user_memories_entities_parent_entity_id_user_memories_entities_id_fk",
"tableFrom": "user_memories_entities",
"tableTo": "user_memories_entities",
- "columnsFrom": [
- "parent_entity_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_entity_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -45428,12 +46433,8 @@
"name": "user_memories_entities_user_id_users_id_fk",
"tableFrom": "user_memories_entities",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45441,12 +46442,8 @@
"name": "user_memories_entities_workspace_id_workspaces_id_fk",
"tableFrom": "user_memories_entities",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45454,12 +46451,8 @@
"name": "user_memories_entities_agent_id_agents_id_fk",
"tableFrom": "user_memories_entities",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45467,12 +46460,8 @@
"name": "user_memories_entities_project_id_projects_id_fk",
"tableFrom": "user_memories_entities",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45480,12 +46469,8 @@
"name": "user_memories_entities_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_entities",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -45648,12 +46633,8 @@
"name": "user_memories_entity_names_entity_id_user_memories_entities_id_fk",
"tableFrom": "user_memories_entity_names",
"tableTo": "user_memories_entities",
- "columnsFrom": [
- "entity_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["entity_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45661,12 +46642,8 @@
"name": "user_memories_entity_names_user_id_users_id_fk",
"tableFrom": "user_memories_entity_names",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45674,12 +46651,8 @@
"name": "user_memories_entity_names_workspace_id_workspaces_id_fk",
"tableFrom": "user_memories_entity_names",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45687,12 +46660,8 @@
"name": "user_memories_entity_names_source_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_entity_names",
"tableTo": "user_memories",
- "columnsFrom": [
- "source_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["source_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -45927,12 +46896,8 @@
"name": "user_memories_experiences_user_id_users_id_fk",
"tableFrom": "user_memories_experiences",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -45940,12 +46905,8 @@
"name": "user_memories_experiences_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_experiences",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -46144,12 +47105,8 @@
"name": "user_memories_identities_user_id_users_id_fk",
"tableFrom": "user_memories_identities",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -46157,12 +47114,8 @@
"name": "user_memories_identities_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_identities",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -46170,12 +47123,8 @@
"name": "user_memories_identities_entity_id_user_memories_entities_id_fk",
"tableFrom": "user_memories_identities",
"tableTo": "user_memories_entities",
- "columnsFrom": [
- "entity_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["entity_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -46357,12 +47306,8 @@
"name": "user_memories_operations_user_id_users_id_fk",
"tableFrom": "user_memories_operations",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -46370,12 +47315,8 @@
"name": "user_memories_operations_workspace_id_workspaces_id_fk",
"tableFrom": "user_memories_operations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -46575,12 +47516,8 @@
"name": "user_memory_persona_document_histories_user_id_users_id_fk",
"tableFrom": "user_memory_persona_document_histories",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -46588,12 +47525,8 @@
"name": "user_memory_persona_document_histories_persona_id_user_memory_persona_documents_id_fk",
"tableFrom": "user_memory_persona_document_histories",
"tableTo": "user_memory_persona_documents",
- "columnsFrom": [
- "persona_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["persona_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -46736,12 +47669,8 @@
"name": "user_memory_persona_documents_user_id_users_id_fk",
"tableFrom": "user_memory_persona_documents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -46966,12 +47895,8 @@
"name": "user_memories_preferences_user_id_users_id_fk",
"tableFrom": "user_memories_preferences",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -46979,12 +47904,8 @@
"name": "user_memories_preferences_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_preferences",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -46992,12 +47913,8 @@
"name": "user_memories_preferences_holder_entity_id_user_memories_entities_id_fk",
"tableFrom": "user_memories_preferences",
"tableTo": "user_memories_entities",
- "columnsFrom": [
- "holder_entity_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["holder_entity_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -47005,12 +47922,8 @@
"name": "user_memories_preferences_applies_to_entity_id_user_memories_entities_id_fk",
"tableFrom": "user_memories_preferences",
"tableTo": "user_memories_entities",
- "columnsFrom": [
- "applies_to_entity_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["applies_to_entity_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -47300,12 +48213,8 @@
"name": "acceptances_user_id_users_id_fk",
"tableFrom": "acceptances",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -47313,12 +48222,8 @@
"name": "acceptances_workspace_id_workspaces_id_fk",
"tableFrom": "acceptances",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -47326,12 +48231,8 @@
"name": "acceptances_project_id_projects_id_fk",
"tableFrom": "acceptances",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -47718,12 +48619,8 @@
"name": "verify_check_results_verify_run_id_verify_runs_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "verify_runs",
- "columnsFrom": [
- "verify_run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["verify_run_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -47731,12 +48628,8 @@
"name": "verify_check_results_operation_id_agent_operations_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -47744,12 +48637,8 @@
"name": "verify_check_results_user_id_users_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -47757,12 +48646,8 @@
"name": "verify_check_results_workspace_id_workspaces_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -47770,12 +48655,8 @@
"name": "verify_check_results_source_criterion_id_verify_criteria_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "verify_criteria",
- "columnsFrom": [
- "source_criterion_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["source_criterion_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -47783,12 +48664,8 @@
"name": "verify_check_results_verifier_operation_id_agent_operations_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "agent_operations",
- "columnsFrom": [
- "verifier_operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["verifier_operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -47796,12 +48673,8 @@
"name": "verify_check_results_verifier_tracing_id_llm_generation_tracing_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "llm_generation_tracing",
- "columnsFrom": [
- "verifier_tracing_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["verifier_tracing_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -47809,12 +48682,8 @@
"name": "verify_check_results_repair_operation_id_agent_operations_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "agent_operations",
- "columnsFrom": [
- "repair_operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["repair_operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -48001,12 +48870,8 @@
"name": "verify_criteria_user_id_users_id_fk",
"tableFrom": "verify_criteria",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -48014,12 +48879,8 @@
"name": "verify_criteria_document_id_documents_id_fk",
"tableFrom": "verify_criteria",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -48027,12 +48888,8 @@
"name": "verify_criteria_workspace_id_workspaces_id_fk",
"tableFrom": "verify_criteria",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -48210,12 +49067,8 @@
"name": "verify_evidence_check_result_id_verify_check_results_id_fk",
"tableFrom": "verify_evidence",
"tableTo": "verify_check_results",
- "columnsFrom": [
- "check_result_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["check_result_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -48223,12 +49076,8 @@
"name": "verify_evidence_document_id_documents_id_fk",
"tableFrom": "verify_evidence",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -48236,12 +49085,8 @@
"name": "verify_evidence_file_id_files_id_fk",
"tableFrom": "verify_evidence",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -48249,12 +49094,8 @@
"name": "verify_evidence_user_id_users_id_fk",
"tableFrom": "verify_evidence",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -48262,12 +49103,8 @@
"name": "verify_evidence_workspace_id_workspaces_id_fk",
"tableFrom": "verify_evidence",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -48457,12 +49294,8 @@
"name": "verify_reports_verify_run_id_verify_runs_id_fk",
"tableFrom": "verify_reports",
"tableTo": "verify_runs",
- "columnsFrom": [
- "verify_run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["verify_run_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -48470,12 +49303,8 @@
"name": "verify_reports_operation_id_agent_operations_id_fk",
"tableFrom": "verify_reports",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -48483,12 +49312,8 @@
"name": "verify_reports_user_id_users_id_fk",
"tableFrom": "verify_reports",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -48496,12 +49321,8 @@
"name": "verify_reports_workspace_id_workspaces_id_fk",
"tableFrom": "verify_reports",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -48751,12 +49572,8 @@
"name": "verify_review_predictions_check_result_id_verify_check_results_id_fk",
"tableFrom": "verify_review_predictions",
"tableTo": "verify_check_results",
- "columnsFrom": [
- "check_result_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["check_result_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -48764,12 +49581,8 @@
"name": "verify_review_predictions_user_id_users_id_fk",
"tableFrom": "verify_review_predictions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -48777,12 +49590,8 @@
"name": "verify_review_predictions_workspace_id_workspaces_id_fk",
"tableFrom": "verify_review_predictions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -48892,12 +49701,8 @@
"name": "verify_rubric_criteria_rubric_id_verify_rubrics_id_fk",
"tableFrom": "verify_rubric_criteria",
"tableTo": "verify_rubrics",
- "columnsFrom": [
- "rubric_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["rubric_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -48905,12 +49710,8 @@
"name": "verify_rubric_criteria_criterion_id_verify_criteria_id_fk",
"tableFrom": "verify_rubric_criteria",
"tableTo": "verify_criteria",
- "columnsFrom": [
- "criterion_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["criterion_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -48918,12 +49719,8 @@
"name": "verify_rubric_criteria_user_id_users_id_fk",
"tableFrom": "verify_rubric_criteria",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -48931,12 +49728,8 @@
"name": "verify_rubric_criteria_workspace_id_workspaces_id_fk",
"tableFrom": "verify_rubric_criteria",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -48944,10 +49737,7 @@
"compositePrimaryKeys": {
"verify_rubric_criteria_rubric_id_criterion_id_pk": {
"name": "verify_rubric_criteria_rubric_id_criterion_id_pk",
- "columns": [
- "rubric_id",
- "criterion_id"
- ]
+ "columns": ["rubric_id", "criterion_id"]
}
},
"uniqueConstraints": {},
@@ -49056,12 +49846,8 @@
"name": "verify_rubrics_user_id_users_id_fk",
"tableFrom": "verify_rubrics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -49069,12 +49855,8 @@
"name": "verify_rubrics_workspace_id_workspaces_id_fk",
"tableFrom": "verify_rubrics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -49346,12 +50128,8 @@
"name": "verify_runs_user_id_users_id_fk",
"tableFrom": "verify_runs",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -49359,12 +50137,8 @@
"name": "verify_runs_workspace_id_workspaces_id_fk",
"tableFrom": "verify_runs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -49372,12 +50146,8 @@
"name": "verify_runs_acceptance_id_acceptances_id_fk",
"tableFrom": "verify_runs",
"tableTo": "acceptances",
- "columnsFrom": [
- "acceptance_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["acceptance_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -49385,12 +50155,8 @@
"name": "verify_runs_operation_id_agent_operations_id_fk",
"tableFrom": "verify_runs",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -49596,12 +50362,8 @@
"name": "widget_runs_widget_id_widgets_id_fk",
"tableFrom": "widget_runs",
"tableTo": "widgets",
- "columnsFrom": [
- "widget_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["widget_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -49609,12 +50371,8 @@
"name": "widget_runs_version_id_widget_versions_id_fk",
"tableFrom": "widget_runs",
"tableTo": "widget_versions",
- "columnsFrom": [
- "version_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["version_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -49622,12 +50380,8 @@
"name": "widget_runs_user_id_users_id_fk",
"tableFrom": "widget_runs",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -49635,12 +50389,8 @@
"name": "widget_runs_workspace_id_workspaces_id_fk",
"tableFrom": "widget_runs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -49901,12 +50651,8 @@
"name": "widget_versions_widget_id_widgets_id_fk",
"tableFrom": "widget_versions",
"tableTo": "widgets",
- "columnsFrom": [
- "widget_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["widget_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -49914,12 +50660,8 @@
"name": "widget_versions_user_id_users_id_fk",
"tableFrom": "widget_versions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -49927,12 +50669,8 @@
"name": "widget_versions_workspace_id_workspaces_id_fk",
"tableFrom": "widget_versions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -49940,12 +50678,8 @@
"name": "widget_versions_published_by_user_id_users_id_fk",
"tableFrom": "widget_versions",
"tableTo": "users",
- "columnsFrom": [
- "published_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["published_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -49953,12 +50687,8 @@
"name": "widget_versions_source_agent_id_agents_id_fk",
"tableFrom": "widget_versions",
"tableTo": "agents",
- "columnsFrom": [
- "source_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["source_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -49966,12 +50696,8 @@
"name": "widget_versions_source_topic_id_topics_id_fk",
"tableFrom": "widget_versions",
"tableTo": "topics",
- "columnsFrom": [
- "source_topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["source_topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -49979,12 +50705,8 @@
"name": "widget_versions_parent_version_id_widget_versions_id_fk",
"tableFrom": "widget_versions",
"tableTo": "widget_versions",
- "columnsFrom": [
- "parent_version_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_version_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -50354,12 +51076,8 @@
"name": "widgets_user_id_users_id_fk",
"tableFrom": "widgets",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -50367,12 +51085,8 @@
"name": "widgets_workspace_id_workspaces_id_fk",
"tableFrom": "widgets",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -50380,12 +51094,8 @@
"name": "widgets_project_id_projects_id_fk",
"tableFrom": "widgets",
"tableTo": "projects",
- "columnsFrom": [
- "project_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -50393,12 +51103,8 @@
"name": "widgets_agent_id_agents_id_fk",
"tableFrom": "widgets",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -50406,12 +51112,8 @@
"name": "widgets_published_version_id_widget_versions_id_fk",
"tableFrom": "widgets",
"tableTo": "widget_versions",
- "columnsFrom": [
- "published_version_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["published_version_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -50419,12 +51121,8 @@
"name": "widgets_draft_version_id_widget_versions_id_fk",
"tableFrom": "widgets",
"tableTo": "widget_versions",
- "columnsFrom": [
- "draft_version_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["draft_version_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -50432,12 +51130,8 @@
"name": "widgets_metric_id_metrics_id_fk",
"tableFrom": "widgets",
"tableTo": "metrics",
- "columnsFrom": [
- "metric_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["metric_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -50751,12 +51445,8 @@
"name": "work_versions_work_id_works_id_fk",
"tableFrom": "work_versions",
"tableTo": "works",
- "columnsFrom": [
- "work_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["work_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -50764,12 +51454,8 @@
"name": "work_versions_topic_id_topics_id_fk",
"tableFrom": "work_versions",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -50777,12 +51463,8 @@
"name": "work_versions_thread_id_threads_id_fk",
"tableFrom": "work_versions",
"tableTo": "threads",
- "columnsFrom": [
- "thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["thread_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -50790,12 +51472,8 @@
"name": "work_versions_message_id_messages_id_fk",
"tableFrom": "work_versions",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -50803,12 +51481,8 @@
"name": "work_versions_agent_id_agents_id_fk",
"tableFrom": "work_versions",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -51197,12 +51871,8 @@
"name": "works_origin_topic_id_topics_id_fk",
"tableFrom": "works",
"tableTo": "topics",
- "columnsFrom": [
- "origin_topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["origin_topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -51210,12 +51880,8 @@
"name": "works_origin_thread_id_threads_id_fk",
"tableFrom": "works",
"tableTo": "threads",
- "columnsFrom": [
- "origin_thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["origin_thread_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -51223,12 +51889,8 @@
"name": "works_origin_agent_id_agents_id_fk",
"tableFrom": "works",
"tableTo": "agents",
- "columnsFrom": [
- "origin_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["origin_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -51236,12 +51898,8 @@
"name": "works_user_id_users_id_fk",
"tableFrom": "works",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -51249,12 +51907,8 @@
"name": "works_workspace_id_workspaces_id_fk",
"tableFrom": "works",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -51378,12 +52032,8 @@
"name": "workspace_audit_logs_workspace_id_workspaces_id_fk",
"tableFrom": "workspace_audit_logs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -51537,12 +52187,8 @@
"name": "workspace_invitations_workspace_id_workspaces_id_fk",
"tableFrom": "workspace_invitations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -51550,12 +52196,8 @@
"name": "workspace_invitations_inviter_id_users_id_fk",
"tableFrom": "workspace_invitations",
"tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["inviter_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -51565,9 +52207,7 @@
"workspace_invitations_token_unique": {
"name": "workspace_invitations_token_unique",
"nullsNotDistinct": false,
- "columns": [
- "token"
- ]
+ "columns": ["token"]
}
},
"policies": {},
@@ -51680,12 +52320,8 @@
"name": "workspace_members_workspace_id_workspaces_id_fk",
"tableFrom": "workspace_members",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -51693,12 +52329,8 @@
"name": "workspace_members_user_id_users_id_fk",
"tableFrom": "workspace_members",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -51706,10 +52338,7 @@
"compositePrimaryKeys": {
"workspace_members_workspace_id_user_id_pk": {
"name": "workspace_members_workspace_id_user_id_pk",
- "columns": [
- "workspace_id",
- "user_id"
- ]
+ "columns": ["workspace_id", "user_id"]
}
},
"uniqueConstraints": {},
@@ -51825,12 +52454,8 @@
"name": "workspace_team_members_workspace_id_workspaces_id_fk",
"tableFrom": "workspace_team_members",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -51838,12 +52463,8 @@
"name": "workspace_team_members_user_id_users_id_fk",
"tableFrom": "workspace_team_members",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -51851,14 +52472,8 @@
"name": "workspace_team_members_team_workspace_fk",
"tableFrom": "workspace_team_members",
"tableTo": "workspace_teams",
- "columnsFrom": [
- "team_id",
- "workspace_id"
- ],
- "columnsTo": [
- "id",
- "workspace_id"
- ],
+ "columnsFrom": ["team_id", "workspace_id"],
+ "columnsTo": ["id", "workspace_id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -51988,12 +52603,8 @@
"name": "workspace_teams_workspace_id_workspaces_id_fk",
"tableFrom": "workspace_teams",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -52001,12 +52612,8 @@
"name": "workspace_teams_created_by_users_id_fk",
"tableFrom": "workspace_teams",
"tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -52016,10 +52623,7 @@
"workspace_teams_id_workspace_unique": {
"name": "workspace_teams_id_workspace_unique",
"nullsNotDistinct": false,
- "columns": [
- "id",
- "workspace_id"
- ]
+ "columns": ["id", "workspace_id"]
}
},
"policies": {},
@@ -52114,12 +52718,8 @@
"name": "workspace_user_settings_workspace_id_workspaces_id_fk",
"tableFrom": "workspace_user_settings",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -52127,12 +52727,8 @@
"name": "workspace_user_settings_user_id_users_id_fk",
"tableFrom": "workspace_user_settings",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -52261,12 +52857,8 @@
"name": "workspaces_primary_owner_id_users_id_fk",
"tableFrom": "workspaces",
"tableTo": "users",
- "columnsFrom": [
- "primary_owner_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["primary_owner_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -52278,26 +52870,6 @@
"isRLSEnabled": false
}
},
- "enums": {},
- "schemas": {},
- "sequences": {
- "public.fts_search_sync_revision_seq": {
- "name": "fts_search_sync_revision_seq",
- "schema": "public",
- "increment": "1",
- "startWith": "1",
- "minValue": "1",
- "maxValue": "9223372036854775807",
- "cache": "1",
- "cycle": false
- }
- },
- "roles": {},
- "policies": {},
- "views": {},
- "_meta": {
- "columns": {},
- "schemas": {},
- "tables": {}
- }
-}
\ No newline at end of file
+ "version": "7",
+ "views": {}
+}
diff --git a/packages/database/migrations/meta/_journal.json b/packages/database/migrations/meta/_journal.json
index 04db923d415..723adb270bb 100644
--- a/packages/database/migrations/meta/_journal.json
+++ b/packages/database/migrations/meta/_journal.json
@@ -1554,6 +1554,13 @@
"when": 1794996111307,
"tag": "0221_project_environment_owner",
"breakpoints": true
+ },
+ {
+ "idx": 222,
+ "version": "7",
+ "when": 1795064606437,
+ "tag": "0222_agent_skill_upstream",
+ "breakpoints": true
}
],
"version": "6"
diff --git a/packages/database/src/models/agentSkill.ts b/packages/database/src/models/agentSkill.ts
index b0f6064ada4..df8093a7ead 100644
--- a/packages/database/src/models/agentSkill.ts
+++ b/packages/database/src/models/agentSkill.ts
@@ -1,6 +1,6 @@
import type { SkillItem, SkillListItem } from '@lobechat/types';
import { merge } from '@lobechat/utils';
-import { and, desc, eq, ilike, inArray, or, sql } from 'drizzle-orm';
+import { and, desc, eq, ilike, inArray, isNotNull, or, sql } from 'drizzle-orm';
import type { NewAgentSkill } from '../schemas';
import { agentSkills } from '../schemas';
@@ -19,6 +19,7 @@ const skillItemColumns = {
resources: agentSkills.resources,
source: agentSkills.source,
updatedAt: agentSkills.updatedAt,
+ upstream: agentSkills.upstream,
// Creator attribution — row-level ownership checks in workspace mode.
userId: agentSkills.userId,
zipFileHash: agentSkills.zipFileHash,
@@ -33,6 +34,7 @@ const skillListColumns = {
name: agentSkills.name,
source: agentSkills.source,
updatedAt: agentSkills.updatedAt,
+ upstream: agentSkills.upstream,
// Creator attribution — row-level ownership checks in workspace mode.
userId: agentSkills.userId,
zipFileHash: agentSkills.zipFileHash,
@@ -82,6 +84,23 @@ export class AgentSkillModel {
return result;
};
+ findGitHubInstalls = async (): Promise<SkillItem[]> =>
+ this.db
+ .select(skillItemColumns)
+ .from(agentSkills)
+ .where(
+ and(
+ this.scopeWhere(),
+ or(
+ isNotNull(agentSkills.upstream),
+ and(
+ eq(agentSkills.source, 'market'),
+ sql`COALESCE(${agentSkills.manifest}->>'sourceUrl', '') <> ''`,
+ ),
+ ),
+ ),
+ );
+
findImportMatches = async (identifiers: string[], names: string[]): Promise<SkillItem[]> =>
this.db
.select(skillItemColumns)
@@ -156,16 +175,23 @@ export class AgentSkillModel {
// ========== Update ==========
update = async (id: string, data: Partial<NewAgentSkill>): Promise<SkillItem> => {
- const existing = await this.findById(id);
-
- const updateData = merge(existing || {}, { ...data, updatedAt: new Date() });
-
- const [result] = await this.db
- .update(agentSkills)
- .set(updateData)
- .where(and(eq(agentSkills.id, id), this.scopeWhere()))
- .returning(skillItemColumns);
- return result;
+ // Editors merge partial manifest fields. Read under a row lock so this
+ // merge cannot restore a previous package after a concurrent GitHub update.
+ return this.db.transaction(async (tx) => {
+ const where = and(eq(agentSkills.id, id), this.scopeWhere());
+ const [existing] = await tx
+ .select(skillItemColumns)
+ .from(agentSkills)
+ .where(where)
+ .for('update');
+ const updateData = merge(existing || {}, { ...data, updatedAt: new Date() });
+ const [result] = await tx
+ .update(agentSkills)
+ .set(updateData)
+ .where(where)
+ .returning(skillItemColumns);
+ return result;
+ });
};
// Serialize GitHub create/name decisions within a library. Only final row
diff --git a/packages/database/src/schemas/agentSkill.ts b/packages/database/src/schemas/agentSkill.ts
index adadea84f90..eb621e3079a 100644
--- a/packages/database/src/schemas/agentSkill.ts
+++ b/packages/database/src/schemas/agentSkill.ts
@@ -1,4 +1,4 @@
-import type { SkillManifest, SkillResourceMeta } from '@lobechat/types';
+import type { GitHubSkillUpstream, SkillManifest, SkillResourceMeta } from '@lobechat/types';
import { isNotNull, isNull, relations } from 'drizzle-orm';
import { index, jsonb, pgTable, text, uniqueIndex, varchar } from 'drizzle-orm/pg-core';
@@ -23,6 +23,8 @@ export const agentSkills = pgTable(
// Source control
source: text('source', { enum: ['builtin', 'market', 'user'] }).notNull(),
+ upstream: jsonb('upstream').$type<GitHubSkillUpstream>(),
+
// Manifest (version, author, repository, etc.)
manifest: jsonb('manifest')
.$type<SkillManifest>()
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index da94b155b3d..c2cf39a0138 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -313,6 +313,23 @@ export default {
'agentSkillDetail.skillContent': 'Skill Content',
'agentSkillDetail.sourceUrl': 'Skill Import Source',
'agentSkillDetail.updatedAt': 'Updated',
+ 'agentSkillUpdate.apply': 'Update skill',
+ 'agentSkillUpdate.branch': 'Branch name (HEAD follows the default branch)',
+ 'agentSkillUpdate.check': 'Check for updates',
+ 'agentSkillUpdate.checking': 'Checking GitHub…',
+ 'agentSkillUpdate.chooseRef': 'Choose a branch to track',
+ 'agentSkillUpdate.current': 'Up to date',
+ 'agentSkillUpdate.failed': 'Couldn’t update the skill',
+ 'agentSkillUpdate.limited': 'GitHub rate limit reached',
+ 'agentSkillUpdate.missing': 'Removed from the source repository',
+ 'agentSkillUpdate.overwriteBody':
+ 'This update replaces your installed copy. It contains local changes or predates edit tracking.',
+ 'agentSkillUpdate.overwriteTitle': 'Replace the installed copy?',
+ 'agentSkillUpdate.pinned': 'Pinned to a commit',
+ 'agentSkillUpdate.replace': 'Replace and update',
+ 'agentSkillUpdate.saved': 'Skill synced with GitHub',
+ 'agentSkillUpdate.track': 'Track branch',
+ 'agentSkillUpdate.unavailable': 'Couldn’t check GitHub',
'agentSkillEdit.descriptionDesc':
'A brief summary of what the skill does, helping the agent understand when to use it',
'agentSkillEdit.fileReadonly':
diff --git a/packages/types/src/skill/index.ts b/packages/types/src/skill/index.ts
index b60ee4f4d4f..73de06e6172 100644
--- a/packages/types/src/skill/index.ts
+++ b/packages/types/src/skill/index.ts
@@ -132,6 +132,23 @@ export interface SkillResourceContent {
// ===== Skill Item (full structure, for detail queries) =====
+export interface GitHubSkillUpstream {
+ /** Absent when a legacy import did not record its installed revision. */
+ installedCommit?: string;
+ /** Fingerprint of editable fields when this package was installed. */
+ installedFingerprint?: string;
+ owner: string;
+ path: string;
+ /** HEAD follows the default branch. A full commit SHA is pinned. */
+ ref: string;
+ repo: string;
+}
+
+export type GitHubSkillCheck =
+ | { status: 'current' | 'missing' | 'unavailable' | 'limited' | 'pinned' }
+ | { revision: string; status: 'chooseRef' }
+ | { commit: string; localChanges: boolean; revision: string; status: 'update' };
+
export interface SkillItem {
content?: string | null;
createdAt: Date;
@@ -144,6 +161,7 @@ export interface SkillItem {
resources?: Record<string, SkillResourceMeta> | null;
source: SkillSource;
updatedAt: Date;
+ upstream?: GitHubSkillUpstream | null;
/** Creator attribution — drives the workspace row-level manage gate. */
userId?: string | null;
zipFileHash?: string | null;
@@ -160,6 +178,7 @@ export interface SkillListItem {
name: string;
source: SkillSource;
updatedAt: Date;
+ upstream?: GitHubSkillUpstream | null;
/** Creator attribution — drives the workspace row-level manage gate. */
userId?: string | null;
zipFileHash?: string | null;
diff --git a/src/features/AgentSkillDetail/GitHubSkillUpdate.tsx b/src/features/AgentSkillDetail/GitHubSkillUpdate.tsx
new file mode 100644
index 00000000000..37d5ae9e483
--- /dev/null
+++ b/src/features/AgentSkillDetail/GitHubSkillUpdate.tsx
@@ -0,0 +1,122 @@
+'use client';
+
+import type { SkillListItem } from '@lobechat/types';
+import { ActionIcon, Button, confirmModal, Flexbox, Input, Text, toast } from '@lobehub/ui';
+import { RefreshCw } from 'lucide-react';
+import { memo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { usePermission } from '@/hooks/usePermission';
+import { useResourceManageable } from '@/hooks/useResourceManageable';
+import { useToolStore } from '@/store/tool';
+import { AGENT_SKILL_LIST_KEY } from '@/store/tool/slices/agentSkills/projection';
+
+export const hasGitHubSource = (skill: SkillListItem) =>
+ !!skill.upstream ||
+ (skill.source === 'market' &&
+ /^(?:https?:\/\/)?(?:github\.com\/|[\w.-]+\/[\w.-]+$)/.test(skill.manifest?.sourceUrl ?? ''));
+
+export const GitHubSkillUpdate = memo<{ compact?: boolean; skill: SkillListItem }>(
+ ({ compact, skill }) => {
+ const { t } = useTranslation('setting');
+ const [saving, setSaving] = useState(false);
+ const { allowed: canEdit } = usePermission('edit_own_content');
+ const canManage = useResourceManageable(skill.userId);
+ const sync = useToolStore((s) => s.syncGitHubSkill);
+ const checks = useToolStore((s) => s.useCheckGitHubSkills)();
+ const status = useToolStore((s) => s.gitHubUpdateMap[AGENT_SKILL_LIST_KEY]?.[skill.id]);
+ const check = checks.error ? { status: 'unavailable' as const } : status;
+ const disabled = saving || !canEdit || !canManage;
+ const save = async (input: Parameters<typeof sync>[0]) => {
+ setSaving(true);
+ try {
+ await sync(input);
+ toast.success(t('agentSkillUpdate.saved'));
+ } catch (error) {
+ toast.error({
+ title: t('agentSkillUpdate.failed'),
+ description: error instanceof Error ? error.message : undefined,
+ });
+ await checks.revalidate();
+ } finally {
+ setSaving(false);
+ }
+ };
+ if (check?.status === 'update') {
+ const apply = () =>
+ save({
+ commit: check.commit,
+ id: skill.id,
+ overwriteLocal: check.localChanges,
+ revision: check.revision,
+ });
+ return (
+ <Button
+ disabled={disabled}
+ loading={saving}
+ size="small"
+ onClick={(event) => {
+ event.stopPropagation();
+ if (check.localChanges)
+ confirmModal({
+ title: t('agentSkillUpdate.overwriteTitle'),
+ content: t('agentSkillUpdate.overwriteBody'),
+ okText: t('agentSkillUpdate.replace'),
+ okButtonProps: { danger: true },
+ onOk: apply,
+ });
+ else void apply();
+ }}
+ >
+ {t('agentSkillUpdate.apply')}
+ </Button>
+ );
+ }
+ if (compact) return null;
+ if (check?.status === 'chooseRef') {
+ return (
+ <Button
+ disabled={disabled}
+ loading={saving}
+ size="small"
+ onClick={() => {
+ let ref = 'HEAD';
+ confirmModal({
+ title: t('agentSkillUpdate.chooseRef'),
+ content: (
+ <Input
+ aria-label={t('agentSkillUpdate.branch')}
+ defaultValue="HEAD"
+ placeholder={t('agentSkillUpdate.branch')}
+ onChange={(event) => {
+ ref = event.target.value.trim();
+ }}
+ />
+ ),
+ okText: t('agentSkillUpdate.track'),
+ onOk: () => save({ id: skill.id, ref: ref || 'HEAD', revision: check.revision }),
+ });
+ }}
+ >
+ {t('agentSkillUpdate.chooseRef')}
+ </Button>
+ );
+ }
+ if (!check && !checks.isValidating) return null;
+ return (
+ <Flexbox horizontal align="center" gap={4}>
+ <Text type="secondary">{t(`agentSkillUpdate.${check?.status ?? 'checking'}`)}</Text>
+ {check?.status !== 'pinned' && (
+ <ActionIcon
+ icon={RefreshCw}
+ loading={checks.isValidating}
+ size="small"
+ title={t('agentSkillUpdate.check')}
+ onClick={() => void checks.revalidate()}
+ />
+ )}
+ </Flexbox>
+ );
+ },
+);
+GitHubSkillUpdate.displayName = 'GitHubSkillUpdate';
diff --git a/src/features/AgentSkillDetail/index.tsx b/src/features/AgentSkillDetail/index.tsx
index 20579d9c729..8596ddb9c22 100644
--- a/src/features/AgentSkillDetail/index.tsx
+++ b/src/features/AgentSkillDetail/index.tsx
@@ -2,7 +2,7 @@
import { type SkillResourceTreeNode } from '@lobechat/types';
import { Github } from '@lobehub/icons';
-import { ActionIcon, createStaticStyles, cssVar, Flexbox, Icon } from '@lobehub/ui';
+import { ActionIcon, createStaticStyles, cssVar, Flexbox, Icon, Text } from '@lobehub/ui';
import { DotIcon, ExternalLinkIcon } from 'lucide-react';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -14,6 +14,7 @@ import FileTree, { FileTreeSkeleton } from '@/features/FileTree';
import { useToolStore } from '@/store/tool';
import ContentViewer from './ContentViewer';
+import { GitHubSkillUpdate, hasGitHubSource } from './GitHubSkillUpdate';
const styles = createStaticStyles(({ css, cssVar }) => ({
description: css`
@@ -167,6 +168,21 @@ const AgentSkillDetail = memo<AgentSkillDetailProps>(({ skillId }) => {
{description && <p className={styles.description}>{description}</p>}
</Flexbox>
</Flexbox>
+ {hasGitHubSource(skillDetail) && (
+ <Flexbox horizontal align="center" gap={8} wrap="wrap">
+ {skillDetail.upstream && (
+ <Text ellipsis fontSize={12} type="secondary">
+ {skillDetail.upstream.owner}/{skillDetail.upstream.repo}
+ {skillDetail.upstream.path && '/' + skillDetail.upstream.path}
+ {' @ '}
+ {skillDetail.upstream.ref === skillDetail.upstream.installedCommit
+ ? skillDetail.upstream.installedCommit.slice(0, 7)
+ : skillDetail.upstream.ref}
+ </Text>
+ )}
+ <GitHubSkillUpdate skill={skillDetail} />
+ </Flexbox>
+ )}
</div>
)}
<Flexbox horizontal style={{ flex: 1, overflow: 'hidden' }}>
diff --git a/src/features/Settings/skill/features/AgentSkillItem.tsx b/src/features/Settings/skill/features/AgentSkillItem.tsx
index cf18c316e3b..6f4b0d26dd1 100644
--- a/src/features/Settings/skill/features/AgentSkillItem.tsx
+++ b/src/features/Settings/skill/features/AgentSkillItem.tsx
@@ -18,6 +18,7 @@ import { DownloadIcon, MoreHorizontalIcon, Plus, Settings2, Trash2 } from 'lucid
import { lazy, memo, Suspense, useState } from 'react';
import { useTranslation } from 'react-i18next';
+import { GitHubSkillUpdate, hasGitHubSource } from '@/features/AgentSkillDetail/GitHubSkillUpdate';
import NavItem from '@/features/NavPanel/components/NavItem';
import { createBuiltinAgentSkillDetailModal } from '@/features/SkillStore/SkillDetail';
import { usePermission } from '@/hooks/usePermission';
@@ -109,6 +110,9 @@ const AgentSkillItem = memo<AgentSkillItemProps>(({ skill, isSelected, onSelect
// ===== Status & Actions =====
+ const updateAction =
+ !isBuiltin && hasGitHubSource(skill) ? <GitHubSkillUpdate compact skill={skill} /> : null;
+
const renderStatus = () => {
if (!isBuiltin) return null;
if (isBuiltinInstalled) {
@@ -223,6 +227,7 @@ const AgentSkillItem = memo<AgentSkillItemProps>(({ skill, isSelected, onSelect
<>
<SkillListRow
active={isSelected}
+ description={updateAction}
title={title}
extra={
showDisconnected ? (
@@ -299,6 +304,7 @@ const AgentSkillItem = memo<AgentSkillItemProps>(({ skill, isSelected, onSelect
return (
<NavItem
active={isSelected}
+ extra={updateAction}
title={title}
titleColor={showDisconnected ? cssVar.colorTextDescription : undefined}
icon={() =>
@@ -343,6 +349,7 @@ const AgentSkillItem = memo<AgentSkillItemProps>(({ skill, isSelected, onSelect
{!onSelect && (
<Flexbox horizontal align="center" gap={8} onClick={stopPropagation}>
{isBuiltin && isBuiltinInstalled && renderStatus()}
+ {updateAction}
{renderActions()}
</Flexbox>
)}
diff --git a/src/services/skill/index.ts b/src/services/skill/index.ts
index deea648b4fb..34e7f4ac7f1 100644
--- a/src/services/skill/index.ts
+++ b/src/services/skill/index.ts
@@ -26,6 +26,23 @@ class AgentSkillService {
// ===== Import =====
+ checkGitHubUpdates() {
+ return lambdaClient.agentSkills.checkGitHubUpdates.query();
+ }
+
+ applyGitHubUpdate(input: {
+ id: string;
+ revision: string;
+ commit: string;
+ overwriteLocal?: boolean;
+ }) {
+ return lambdaClient.agentSkills.applyGitHubUpdate.mutate(input);
+ }
+
+ trackLegacyGitHubSkill(input: { id: string; revision: string; ref: string }) {
+ return lambdaClient.agentSkills.trackLegacyGitHubSkill.mutate(input);
+ }
+
discoverGitHubSkills(gitUrl: string): Promise<GitHubSkillDiscovery> {
return lambdaClient.agentSkills.discoverGitHubSkills.mutate({ gitUrl });
}
diff --git a/src/store/tool/slices/agentSkills/action.test.ts b/src/store/tool/slices/agentSkills/action.test.ts
index 6940973824d..54753fea54b 100644
--- a/src/store/tool/slices/agentSkills/action.test.ts
+++ b/src/store/tool/slices/agentSkills/action.test.ts
@@ -30,6 +30,8 @@ import {
vi.mock('@/services/skill', () => ({
agentSkillService: {
+ applyGitHubUpdate: vi.fn(),
+ checkGitHubUpdates: vi.fn(),
createSkill: vi.fn(),
deleteSkill: vi.fn(),
getById: vi.fn(),
@@ -136,6 +138,28 @@ describe('agentSkills replicas', () => {
);
});
+ it('refreshes the installed package body and resource tree used by chat after an update', async () => {
+ const item = skill('db-1');
+ const latest = { ...item, content: 'New instructions' };
+ const resources = [{ name: 'new.md', path: 'new.md', type: 'file' as const }];
+ vi.mocked(agentSkillService.list).mockResolvedValue({ data: [item], total: 1 });
+ vi.mocked(agentSkillService.getById).mockResolvedValue(latest);
+ vi.mocked(agentSkillService.listResources).mockResolvedValue(resources);
+ vi.mocked(agentSkillService.checkGitHubUpdates).mockResolvedValue({
+ [item.id]: { status: 'current' },
+ });
+ await act(async () => {
+ await useToolStore
+ .getState()
+ .syncGitHubSkill({ id: item.id, commit: 'a'.repeat(40), revision: 'preview' });
+ });
+ expect(useToolStore.getState().agentSkillDetailMap[item.id]).toEqual({
+ skillDetail: latest,
+ resourceTree: resources,
+ });
+ expect(useToolStore.getState().gitHubUpdateMap.all[item.id]).toEqual({ status: 'current' });
+ });
+
it('paints a skill detail page (skill + resource tree) from the persisted copy', async () => {
await agentSkillDetailResource.storage!.set(
{ queryKey: 'db-1', scope },
diff --git a/src/store/tool/slices/agentSkills/action.ts b/src/store/tool/slices/agentSkills/action.ts
index eade22da925..22e66d89187 100644
--- a/src/store/tool/slices/agentSkills/action.ts
+++ b/src/store/tool/slices/agentSkills/action.ts
@@ -27,6 +27,8 @@ import {
agentSkillListEntity,
type AgentSkillListItem,
agentSkillListResource,
+ type GitHubUpdateChecks,
+ gitHubUpdateResource,
} from './projection';
import { agentSkillsSelectors } from './selectors';
@@ -57,6 +59,7 @@ export const createAgentSkillsSlice = (set: Setter, get: () => ToolStore, _api?:
new AgentSkillsActionImpl(set, get, _api);
export class AgentSkillsActionImpl {
+ readonly #updates;
readonly #detail;
readonly #get: () => ToolStore;
readonly #list;
@@ -66,6 +69,14 @@ export class AgentSkillsActionImpl {
constructor(set: Setter, get: () => ToolStore, _api?: unknown) {
void _api;
this.#get = get;
+ this.#updates = createReplicaSlice(gitHubUpdateResource, {
+ actionPrefix: 'agentSkillGitHubUpdates',
+ fetcher: () => agentSkillService.checkGitHubUpdates(),
+ get,
+ set,
+ stateKey: 'gitHubUpdateReplica',
+ view: recordLens<ToolStore, GitHubUpdateChecks>('gitHubUpdateMap'),
+ });
this.#list = createReplicaSlice(agentSkillListResource, {
actionPrefix: 'agentSkillList',
entity: agentSkillListEntity,
@@ -182,6 +193,25 @@ export class AgentSkillsActionImpl {
await this.#refreshList();
};
+ useCheckGitHubSkills = () =>
+ this.#updates.useSync(LIST_PARAMS, { dedupingInterval: 10 * 60_000 });
+
+ syncGitHubSkill = async (
+ input: { id: string; revision: string } & (
+ { commit: string; overwriteLocal?: boolean } | { ref: string }
+ ),
+ ) => {
+ const scope = this.#captureScope();
+ if ('commit' in input) await agentSkillService.applyGitHubUpdate(input);
+ else await agentSkillService.trackLegacyGitHubSkill(input);
+ if (this.#isCurrentScope(scope))
+ await Promise.all([
+ this.#detail.fetch(input.id, { fresh: true }),
+ this.#refreshList(),
+ this.#updates.fetch(LIST_PARAMS, { fresh: true }),
+ ]);
+ };
+
updateAgentSkill = async (
params: UpdateSkillInput,
): Promise<AgentSkillDetailItem | undefined> => {
diff --git a/src/store/tool/slices/agentSkills/initialState.ts b/src/store/tool/slices/agentSkills/initialState.ts
index d028f9ef0c7..381cd8b9953 100644
--- a/src/store/tool/slices/agentSkills/initialState.ts
+++ b/src/store/tool/slices/agentSkills/initialState.ts
@@ -1,6 +1,6 @@
import { createReplicaState, type ReplicaState } from '@/libs/replica';
-import type { AgentSkillDetail, AgentSkillListItem } from './projection';
+import type { AgentSkillDetail, AgentSkillListItem, GitHubUpdateChecks } from './projection';
export interface AgentSkillsState {
/** Replica view of the loaded skill details, one entry per skill id. */
@@ -11,9 +11,13 @@ export interface AgentSkillsState {
agentSkillListMap: Record<string, AgentSkillListItem[]>;
/** Replica bookkeeping of `agentSkillListMap`. */
agentSkillListReplica: ReplicaState<AgentSkillListItem[]>;
+ gitHubUpdateMap: Record<string, GitHubUpdateChecks>;
+ gitHubUpdateReplica: ReplicaState<GitHubUpdateChecks>;
}
export const initialAgentSkillsState: AgentSkillsState = {
+ gitHubUpdateMap: {},
+ gitHubUpdateReplica: createReplicaState(),
agentSkillDetailMap: {},
agentSkillDetailReplica: createReplicaState(),
agentSkillListMap: {},
diff --git a/src/store/tool/slices/agentSkills/projection.ts b/src/store/tool/slices/agentSkills/projection.ts
index 9f69edda94a..391c1caba6d 100644
--- a/src/store/tool/slices/agentSkills/projection.ts
+++ b/src/store/tool/slices/agentSkills/projection.ts
@@ -1,4 +1,4 @@
-import type { SkillResourceTreeNode } from '@lobechat/types';
+import type { GitHubSkillCheck, SkillResourceTreeNode } from '@lobechat/types';
import { arrayEntity, defineReplica, type ReplicaEntityAdapter } from '@/libs/replica';
import type { agentSkillService } from '@/services/skill';
@@ -28,6 +28,15 @@ export interface AgentSkillDetail {
*/
export const AGENT_SKILL_LIST_KEY = 'all';
+export type GitHubUpdateChecks = Record<string, GitHubSkillCheck>;
+
+export const gitHubUpdateResource = defineReplica<Record<string, never>, GitHubUpdateChecks>({
+ key: () => AGENT_SKILL_LIST_KEY,
+ name: 'agentSkillGitHubUpdates',
+ storage: 'memory',
+ version: 1,
+});
+
/** Every installed skill of the active scope (`agentSkillListMap.all`). */
export const agentSkillListResource = defineReplica<
Record<string, never>,